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