File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed
Expand file tree Collapse file tree 1 file changed +54
-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+ branches : ['deploy']
6+
7+
8+ env :
9+ REGISTRY : ghcr.io
10+ IMAGE_NAME : ${{ github.repository }}
11+
12+
13+ jobs :
14+ build-and-push-image :
15+ runs-on : ubuntu-latest
16+
17+ permissions :
18+ contents : read
19+ packages : write
20+ attestations : write
21+ id-token : write
22+
23+ steps :
24+ - name : Checkout repository
25+ uses : actions/checkout@v5
26+
27+ - name : Log in to the Container registry
28+ uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
29+ with :
30+ registry : ${{ env.REGISTRY }}
31+ username : ${{ github.actor }}
32+ password : ${{ secrets.GITHUB_TOKEN }}
33+
34+ - name : Extract metadata (tags, labels) for Docker
35+ id : meta
36+ uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
37+ with :
38+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39+
40+ - name : Build and push Docker image
41+ id : push
42+ uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
43+ with :
44+ context : .
45+ push : true
46+ tags : ${{ steps.meta.outputs.tags }}
47+ labels : ${{ steps.meta.outputs.labels }}
48+
49+ - name : Generate artifact attestation
50+ uses : actions/attest-build-provenance@v3
51+ with :
52+ subject-name : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
53+ subject-digest : ${{ steps.push.outputs.digest }}
54+ push-to-registry : true
You can’t perform that action at this time.
0 commit comments