diff --git a/.github/workflows/publish-device-plugin.yml b/.github/workflows/publish-device-plugin.yml new file mode 100644 index 0000000..d17bd4a --- /dev/null +++ b/.github/workflows/publish-device-plugin.yml @@ -0,0 +1,54 @@ +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