forked from agentrust-io/ca2a
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.55 KB
/
Copy pathdocker.yml
File metadata and controls
58 lines (48 loc) · 1.55 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
55
56
57
58
name: Docker publish
on:
push:
tags:
- "v*"
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write # keyless cosign signing + provenance attestation (OIDC)
attestations: write # actions/attest-build-provenance
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract tag name
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
- name: Build and push
id: build
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: |
ghcr.io/agentrust-io/ca2a-runtime:${{ steps.tag.outputs.tag }}
ghcr.io/agentrust-io/ca2a-runtime:latest
- name: Install cosign
uses: sigstore/cosign-installer@v3
- name: Sign the image (keyless, by digest)
env:
DIGEST: ${{ steps.build.outputs.digest }}
run: cosign sign --yes ghcr.io/agentrust-io/ca2a-runtime@${DIGEST}
- name: Attest build provenance (SLSA)
uses: actions/attest-build-provenance@v4
with:
subject-name: ghcr.io/agentrust-io/ca2a-runtime
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: true