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