File tree 1 file changed +50
-0
lines changed
1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ name : build
3
+
4
+ on :
5
+ push :
6
+ tags : [ '*' ]
7
+
8
+ jobs :
9
+ # Reference:
10
+ # https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-docker-images#publishing-images-to-github-packages
11
+ build-and-push-image :
12
+ runs-on : ubuntu-latest
13
+
14
+ permissions :
15
+ contents : read
16
+ packages : write
17
+ attestations : write
18
+ id-token : write
19
+
20
+ steps :
21
+ - name : Checkout repository
22
+ uses : actions/checkout@v4
23
+
24
+ - name : Log in to the Container registry
25
+ uses : docker/login-action@v3
26
+ with :
27
+ registry : ghcr.io
28
+ username : ${{ github.actor }}
29
+ password : ${{ secrets.GITHUB_TOKEN }}
30
+
31
+ - name : Extract metadata (tags, labels) for Docker
32
+ id : meta
33
+ uses : docker/metadata-action@v5
34
+ with :
35
+ images : ghcr.io/${{ github.repository }}
36
+
37
+ - name : Build and push Docker image
38
+ id : push
39
+ uses : docker/build-push-action@v6
40
+ with :
41
+ context : .
42
+ push : true
43
+ tags : ${{ steps.meta.outputs.tags }}
44
+
45
+ - name : Generate artifact attestation
46
+ uses : actions/attest-build-provenance@v2
47
+ with :
48
+ subject-name : ghcr.io/${{ github.repository }}
49
+ subject-digest : ${{ steps.push.outputs.digest }}
50
+ push-to-registry : true
You can’t perform that action at this time.
0 commit comments