Skip to content

Commit d2791a7

Browse files
committed
ci: publish pyhl container image to GHCR
Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent cb0f73e commit d2791a7

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/publish-examples.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
tags: ['v*']
88
paths:
99
- 'examples/**'
10+
- 'host/**'
1011
- 'runtimes/**'
1112
- '.github/workflows/publish-examples.yml'
1213

@@ -230,6 +231,37 @@ jobs:
230231
docker push $VERSION_TAG
231232
fi
232233
234+
# Publish a runnable pyhl container image (pyhl + kernel + initrd).
235+
# Designed for the hyperlight-on-kubernetes device plugin — the pod
236+
# gets /dev/kvm and pyhl handles VM lifecycle internally.
237+
publish-pyhl:
238+
needs: [publish-pyhl-initrd, publish-kernels]
239+
runs-on: ubuntu-latest
240+
permissions:
241+
contents: read
242+
packages: write
243+
steps:
244+
- uses: actions/checkout@v4
245+
246+
- name: Log in to GHCR
247+
uses: docker/login-action@v3
248+
with:
249+
registry: ${{ env.REGISTRY }}
250+
username: ${{ github.actor }}
251+
password: ${{ secrets.GITHUB_TOKEN }}
252+
253+
- name: Build and push pyhl image
254+
run: |
255+
IMAGE=${{ env.IMAGE_BASE }}/pyhl:latest
256+
docker build --platform linux/amd64 \
257+
-f host/pyhl.Dockerfile -t $IMAGE .
258+
docker push $IMAGE
259+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
260+
VERSION_TAG=${{ env.IMAGE_BASE }}/pyhl:${{ github.ref_name }}
261+
docker tag $IMAGE $VERSION_TAG
262+
docker push $VERSION_TAG
263+
fi
264+
233265
# Publish the python-agent-driver rootfs CPIO as its own image so
234266
# `pyhl setup` can pull the initrd (and kernel, above) from GHCR
235267
# without having to build the driver image locally.

0 commit comments

Comments
 (0)