Skip to content

Commit

Permalink
Update actions to create images with gitsha
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Jan 31, 2025
1 parent 18a9c0d commit 1e9d9dd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Get Git Commit SHA
run: echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

# Enable BuildKit for docker builds. This enables building
# multi-platform images and exporting the layer cache
# https://github.com/docker/setup-buildx-action
Expand All @@ -40,12 +43,14 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# https://github.com/docker/build-push-action
- name: Build and push Docker image
- name: Build and push Docker image with Git SHA
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.GIT_SHA }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 1e9d9dd

Please sign in to comment.