Skip to content

Commit a67b556

Browse files
committed
ci: publish versioned GHCR tags on release (v*)
Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent 90f1d3b commit a67b556

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/publish-examples.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
workflow_dispatch:
55
push:
66
branches: [main]
7+
tags: ['v*']
78
paths:
89
- 'examples/**'
910
- 'runtimes/**'
@@ -48,6 +49,12 @@ jobs:
4849
-f runtimes/${{ matrix.runtime }}.Dockerfile \
4950
-t $IMAGE runtimes/
5051
docker push $IMAGE
52+
# Also tag with the release version when triggered by a git tag
53+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
54+
VERSION_TAG=${{ env.IMAGE_BASE }}/${{ matrix.runtime }}-base:${{ github.ref_name }}
55+
docker tag $IMAGE $VERSION_TAG
56+
docker push $VERSION_TAG
57+
fi
5158
5259
# Build and publish kernels for each example
5360
publish-kernels:
@@ -152,6 +159,11 @@ jobs:
152159
DEOF
153160
docker build -f /tmp/Dockerfile.kernel -t $IMAGE .
154161
docker push $IMAGE
162+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
163+
VERSION_TAG=${{ env.IMAGE_BASE }}/${{ matrix.example.name }}-kernel:${{ github.ref_name }}
164+
docker tag $IMAGE $VERSION_TAG
165+
docker push $VERSION_TAG
166+
fi
155167
156168
# Publish the python-agent-driver rootfs CPIO as its own image so
157169
# `pyhl setup` can pull the initrd (and kernel, above) from GHCR
@@ -205,3 +217,8 @@ jobs:
205217
DEOF
206218
docker build -f /tmp/Dockerfile.initrd -t $IMAGE .
207219
docker push $IMAGE
220+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
221+
VERSION_TAG=${{ env.IMAGE_BASE }}/python-agent-driver-initrd:${{ github.ref_name }}
222+
docker tag $IMAGE $VERSION_TAG
223+
docker push $VERSION_TAG
224+
fi

0 commit comments

Comments
 (0)