Skip to content

Commit 24de9ab

Browse files
committed
Add support for Git tags
1 parent 0c5373d commit 24de9ab

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/container-images.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- main
7+
tags:
8+
- '**'
79
pull_request:
810
branches:
911
- main
@@ -47,6 +49,15 @@ jobs:
4749
with:
4850
platforms: ${{ env.IMAGE_PLATFORMS }}
4951

52+
- name: info
53+
id: info
54+
run: |
55+
VERSION=dev
56+
if [ "${{ github.ref_type }}" = 'tag' ]; then
57+
VERSION="${{ github.ref_name }}"
58+
fi
59+
echo "VERSION=${VERSION}" | tee -a "$GITHUB_OUTPUT"
60+
5061
# FIXME: disable provenance due to https://github.com/snok/container-retention-policy/issues/63
5162
- name: build and push container images
5263
run: |
@@ -56,6 +67,7 @@ jobs:
5667
esac
5768
5869
make image-${{ matrix.image }} \
70+
VERSION=${{ steps.info.outputs.VERSION }} \
5971
IMAGE_PLATFORMS=${{ env.IMAGE_PLATFORMS }} \
6072
BUILDX_OUTPUT="${BUILDX_OUTPUT} --provenance=false"
6173

0 commit comments

Comments
 (0)