Skip to content

Commit

Permalink
CI: Generate Docker image with commit SHA1
Browse files Browse the repository at this point in the history
Close #287
  • Loading branch information
henrybear327 committed Jan 5, 2024
1 parent bfff110 commit f30cea7
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 f30cea7

Please sign in to comment.