Skip to content

Commit

Permalink
Tag images correctly
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Finucane <[email protected]>
  • Loading branch information
stephenfin committed Oct 31, 2024
1 parent ff1c18c commit 528df4e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/publish-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
name: Publish container image
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
jobs:
push_to_registry:
name: Push container image to GitHub Container Registry
Expand All @@ -21,8 +22,10 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate tag name
run: echo "IMAGE_TAG=${BRANCH/\//-}" >> $GITHUB_ENV
- name: Build and push container image
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/${{ github.repository }}:latest
tags: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}

0 comments on commit 528df4e

Please sign in to comment.