Adds job to push new version of device plugin to ghcr on push to main… #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |