Skip to content

Adds job to push new version of device plugin to ghcr on push to main… #1

Adds job to push new version of device plugin to ghcr on push to main…

Adds job to push new version of device plugin to ghcr on push to main… #1

name: Publish Device Plugin
on:
push:
branches: [main]
paths:
- 'device-plugin/**'
- '.github/workflows/publish-device-plugin.yml'
env:
REGISTRY: ghcr.io
IMAGE_NAME: hyperlight-dev/hyperlight-device-plugin
jobs:
build-and-push:
name: Build and Push to GHCR
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=sha,prefix=
type=ref,event=branch
- name: Build and push
uses: docker/build-push-action@v6
with:
context: device-plugin
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max