Skip to content

Commit

Permalink
Create build-publish-attest-container.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlovelltroy authored Jan 22, 2024
1 parent d6bf46d commit d2ccf89
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build-publish-attest-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build-image-with-provenance

on:
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
contents: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
id: push
uses: docker/build-push-action@v5.0.0
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
- name: Attest image
uses: github-early-access/generate-build-provenance@main
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

0 comments on commit d2ccf89

Please sign in to comment.