Skip to content

Commit

Permalink
ci: use Docker cache
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed Mar 6, 2024
1 parent c9a64ed commit b5dc735
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/dockerpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Extract GIT metadata for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}
tags: |
Expand All @@ -43,7 +43,7 @@ jobs:
type=raw,value=latest,enable={{is_default_branch}}
- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -61,12 +61,17 @@ jobs:
run: echo "SENTRY_RELEASE=${{steps.meta.outputs.version}}" >> $GITHUB_ENV
if: ${{steps.meta.outputs.version != 'latest'}}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and publish image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
IMAGE_BUILD_TIMESTAMP=${{env.IMAGE_BUILD_TIMESTAMP}}
SENTRY_RELEASE=${{env.SENTRY_RELEASE}}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit b5dc735

Please sign in to comment.