Skip to content

Commit

Permalink
Merge pull request sysprog21#320 from henrybear327/ci/add_commit_hash…
Browse files Browse the repository at this point in the history
…_to_image_tag

CI: Generate Docker image with commit SHA1
  • Loading branch information
jserv authored Jan 5, 2024
2 parents bfff110 + f30cea7 commit 664f90d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
- name: Get short commit SHA1
shell: bash
run: |
echo "short_hash=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
- name: Build and push
uses: docker/build-push-action@v5
if: ${{ steps.changed-files.outputs.any_changed == 'true' }}
with:
context: .
platforms: linux/amd64,linux/arm64/v8
push: ${{ github.event_name == 'push' }}
tags: sysprog21/rv32emu:latest
tags: sysprog21/rv32emu:latest, sysprog21/rv32emu:${{ env.short_hash }}

0 comments on commit 664f90d

Please sign in to comment.