Skip to content

Commit 4c239d8

Browse files
committed
Add attestation to docker
1 parent 892bfde commit 4c239d8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/docker.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
permissions:
1919
contents: read
2020
packages: write
21+
id-token: write
22+
attestations: write
23+
artifact-metadata: write
2124

2225
steps:
2326
- name: Checkout repository
@@ -67,6 +70,7 @@ jobs:
6770
type=semver,pattern={{major}}.{{minor}}.{{patch}}
6871
6972
- name: Build and push Docker image
73+
id: build
7074
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8
7175
with:
7276
context: .
@@ -77,6 +81,13 @@ jobs:
7781
cache-from: type=local,src=/tmp/.buildx-cache
7882
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
7983

84+
- name: Attest build provenance
85+
if: github.event_name != 'pull_request'
86+
uses: actions/attest-build-provenance@v3.2.0
87+
with:
88+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
89+
subject-digest: ${{ steps.build.outputs.digest }}
90+
8091
- # Temp fix
8192
# https://github.com/docker/build-push-action/issues/252
8293
# https://github.com/moby/buildkit/issues/1896

0 commit comments

Comments
 (0)