forked from PinSpace-Org/GistPin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprovenance.yml
More file actions
54 lines (44 loc) 路 1.43 KB
/
Copy pathprovenance.yml
File metadata and controls
54 lines (44 loc) 路 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Container Image Provenance
on:
push:
branches: [main]
paths:
- "Backend/**"
- "Frontend/**"
- "infrastructure/ci/provenance.yml"
permissions:
contents: read
packages: write
id-token: write
jobs:
provenance:
name: Generate Provenance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install sigstore cosign
uses: sigstore/cosign-installer@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push backend image
uses: docker/build-push-action@v5
with:
context: ./Backend
push: true
tags: ghcr.io/pinspace-org/gistpin-backend:${{ github.sha }}
- name: Generate SLSA provenance
uses: slsa-framework/slsa-github-generator@v1
with:
artifact_path: Backend
artifact_digest: ${{ steps.build.outputs.digest }}
- name: Sign image with cosign
run: |
cosign sign --yes ghcr.io/pinspace-org/gistpin-backend:${{ github.sha }}
- name: Verify provenance
run: bash infrastructure/scripts/sign-with-sigstore.sh verify ghcr.io/pinspace-org/gistpin-backend:${{ github.sha }}
- name: Enforce provenance policy
run: bash infrastructure/scripts/sign-with-sigstore.sh enforce