Skip to content

Commit

Permalink
add per-commit image tag
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmoron authored Jul 2, 2023
1 parent 239db34 commit d2e5b6f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ jobs:
- name: Get version from package.json
id: package-version
uses: martinbeentjes/[email protected]
- name: Get short commit hash
id: commit-hash
run: echo "commit_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
tags: |
type=raw,value=latest
type=raw,value=${{ steps.package-version.outputs.current-version }}
type=raw,value=${{ steps.package-version.outputs.current-version }}-${{ steps.commit-hash.outputs.commit_short }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
Expand Down

0 comments on commit d2e5b6f

Please sign in to comment.