Skip to content

Commit 5b17d61

Browse files
ci: modify image tagging behavior
push to 'main' updates 'latest' and SHA tag push to 'rhoai-v*' updates 'rhoai-v*-latest' and SHA tag push elsewhere updates just SHA tag Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
1 parent a281b66 commit 5b17d61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/redhat-distro-container.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,6 @@ jobs:
137137
file: distribution/Containerfile
138138
platforms: ${{ matrix.platform }}
139139
push: true
140-
tags: ${{ env.IMAGE_NAME }}:${{ github.sha }}${{ github.ref == 'refs/heads/main' && format(',{0}:latest', env.IMAGE_NAME) || '' }} # only update 'latest' tag if push is to the 'main' branch
140+
tags: ${{ env.IMAGE_NAME }}:${{ github.sha }}${{ github.ref == 'refs/heads/main' && format(',{0}:latest', env.IMAGE_NAME) || (startsWith(github.ref, 'refs/heads/rhoai-v') && format(',{0}:{1}-latest', env.IMAGE_NAME, github.ref_name)) || '' }} # update 'latest' on main, '<branch-name>-latest' on rhoai-v* branches
141141
cache-from: type=gha
142142
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)