Skip to content

Commit 528df4e

Browse files
committed
Tag images correctly
Signed-off-by: Stephen Finucane <stephen@that.guru>
1 parent ff1c18c commit 528df4e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/publish-image.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
name: Publish container image
33
on:
44
push:
5-
pull_request:
65
concurrency:
76
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
87
cancel-in-progress: true
8+
env:
9+
BRANCH: ${{ github.head_ref || github.ref_name }}
910
jobs:
1011
push_to_registry:
1112
name: Push container image to GitHub Container Registry
@@ -21,8 +22,10 @@ jobs:
2122
registry: ghcr.io
2223
username: ${{ github.actor }}
2324
password: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Generate tag name
26+
run: echo "IMAGE_TAG=${BRANCH/\//-}" >> $GITHUB_ENV
2427
- name: Build and push container image
2528
uses: docker/build-push-action@v6
2629
with:
2730
push: true
28-
tags: ghcr.io/${{ github.repository }}:latest
31+
tags: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}

0 commit comments

Comments
 (0)