Skip to content

Commit

Permalink
Get short commit hash in separate step (fixes GEWISGH-1848)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomudding committed Jun 23, 2024
1 parent c474e43 commit 5f1cf84
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Get short commit SHA
run: echo "SHORT_COMMIT_SHA=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV

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

Expand All @@ -39,7 +42,7 @@ jobs:
- name: Build and push image
uses: docker/build-push-action@v6
with:
build-args: GIT_COMMIT=${{ github.sha }}
build-args: GIT_COMMIT=${{ env.SHORT_COMMIT_SHA }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: ${{ matrix.image == 'web' && '.' || format('./docker/{0}', matrix.image) }}
Expand Down

0 comments on commit 5f1cf84

Please sign in to comment.