Skip to content

feat: squash changes from git.kvd.studio/r/primerdriver #10

feat: squash changes from git.kvd.studio/r/primerdriver

feat: squash changes from git.kvd.studio/r/primerdriver #10

name: Build and push Docker image
on:
push:
branches: [ main ]
concurrency:
group: build
cancel-in-progress: true
jobs:
build-and-push:
name: Build and push
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code repo
uses: actions/checkout@v4
- name: Docker login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Extract image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
- name: Build and push
id: build
uses: docker/build-push-action@v6
with:
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ github.sha }}
ghcr.io/${{ github.repository }}:latest
labels: ${{ steps.meta.outputs.labels }}
file: web.Dockerfile
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ghcr.io/${{ github.repository }}-web
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: true