Skip to content

ops: improve ci by attesting build #37

ops: improve ci by attesting build

ops: improve ci by attesting build #37

Workflow file for this run

name: Build Docker Image
on:
push:
branches:
- main
env:
IMAGE_NAME: drawbu.dev
REGISTRY: ghcr.io
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Nix
uses: cachix/install-nix-action@v30
- name: Build Docker image
run: nix build .#docker
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Docker image to GitHub Container Registry
run: |
docker load < result
docker push ${{ env.IMAGE_NAME }} ghcr.io/${{ github.repository }}
- name: Attest
uses: actions/attest-build-provenance@v1
id: attest
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true