Skip to content

Commit fb6cce9

Browse files
authored
Adds job to push new version of device plugin to ghcr on push to main (#2)
Signed-off-by: Simon Davies <[email protected]>
1 parent f521c6c commit fb6cce9

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Publish Device Plugin
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'device-plugin/**'
8+
- '.github/workflows/publish-device-plugin.yml'
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: hyperlight-dev/hyperlight-device-plugin
13+
14+
jobs:
15+
build-and-push:
16+
name: Build and Push to GHCR
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Log in to GHCR
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ${{ env.REGISTRY }}
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Extract metadata
37+
id: meta
38+
uses: docker/metadata-action@v5
39+
with:
40+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41+
tags: |
42+
type=raw,value=latest
43+
type=sha,prefix=
44+
type=ref,event=branch
45+
46+
- name: Build and push
47+
uses: docker/build-push-action@v6
48+
with:
49+
context: device-plugin
50+
push: true
51+
tags: ${{ steps.meta.outputs.tags }}
52+
labels: ${{ steps.meta.outputs.labels }}
53+
cache-from: type=gha
54+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)