File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 22name : Publish container image
33on :
44 push :
5- pull_request :
65concurrency :
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 }}
910jobs :
1011 push_to_registry :
1112 name : Push container image to GitHub Container Registry
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 }}
You can’t perform that action at this time.
0 commit comments