Skip to content

Commit a04a011

Browse files
authored
Merge pull request #561 from Kuadrant/fix-build-image
fix build images for semantically versioned tags
2 parents dbeb8a3 + bbeece8 commit a04a011

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/build-images.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
outputs:
2121
version: ${{ steps.build-info.outputs.version }}
22+
version_tag: ${{ steps.build-info.outputs.version_tag }}
2223
git_sha: ${{ steps.build-info.outputs.git_sha }}
2324
dirty: ${{ steps.build-info.outputs.dirty }}
2425
steps:
@@ -28,10 +29,13 @@ jobs:
2829
if [[ ${GITHUB_REF_NAME/\//-} =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.+)?$ ]]; then
2930
tag=${GITHUB_REF_NAME/\//-}
3031
echo "version=${tag#v}" >> $GITHUB_OUTPUT
32+
echo "version_tag=${tag}" >> $GITHUB_OUTPUT
3133
elif [[ ${GITHUB_REF_NAME/\//-} == "main" ]]; then
3234
echo "version=latest" >> $GITHUB_OUTPUT
35+
echo "version_tag=latest" >> $GITHUB_OUTPUT
3336
else
3437
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
38+
echo "version_tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
3539
fi
3640
echo "git_sha=${{ github.sha }}" >> $GITHUB_OUTPUT
3741
echo "dirty=false" >> $GITHUB_OUTPUT
@@ -108,7 +112,7 @@ jobs:
108112
with:
109113
images: ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/authorino
110114
tags: |
111-
type=ref,event=branch
115+
type=raw,value=${{ github.ref_name }},enable={{is_not_default_branch}}
112116
type=raw,value=${{ github.sha }}
113117
type=raw,value=latest,enable={{is_default_branch}}
114118
- name: Login to registry
@@ -127,4 +131,4 @@ jobs:
127131
- name: Inspect image
128132
if: ${{ !env.ACT }}
129133
run: |
130-
docker buildx imagetools inspect ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/authorino:${{ needs.prepare.outputs.version }}
134+
docker buildx imagetools inspect ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/authorino:${{ needs.prepare.outputs.version_tag }}

0 commit comments

Comments
 (0)