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