Skip to content

Commit

Permalink
Attest docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
m1guelpf authored Oct 8, 2024
1 parent 035cd8f commit 8a0fab5
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ on:
tags: ["v*.*.*"]
branches: ["main"]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
attestations: write

steps:
- name: Checkout repository
Expand All @@ -23,7 +21,7 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ghcr.io/${{ github.repository }}
tags: |
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
Expand All @@ -46,3 +44,11 @@ jobs:
file: ./Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Attest
id: attest
uses: actions/attest-build-provenance@v1
with:
push-to-registry: true
subject-name: ghcr.io/${{ github.repository }}
subject-digest: ${{ steps.docker_build.outputs.digest }}

0 comments on commit 8a0fab5

Please sign in to comment.