File tree Expand file tree Collapse file tree 1 file changed +43
-9
lines changed
Expand file tree Collapse file tree 1 file changed +43
-9
lines changed Original file line number Diff line number Diff line change 1- name : Build Docker Image
1+ name : Build and Publish Docker Image
22
33on :
44 push :
5- branches :
6- - main
7- pull_request :
5+ tags :
6+ - " v*"
7+
8+ env :
9+ REGISTRY : ghcr.io
10+ IMAGE_NAME : ${{ github.repository }}
811
912jobs :
10- build :
13+ build-and-push-image :
1114 runs-on : ubuntu-latest
15+ permissions :
16+ contents : read
17+ packages : write
18+ attestations : write
19+ id-token : write
1220 steps :
13- - name : Checkout
14- uses : actions/checkout@v4
21+ - name : Checkout repository
22+ uses : actions/checkout@v5
23+
24+ - name : Log in to the Container registry
25+ uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
26+ with :
27+ registry : ${{ env.REGISTRY }}
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@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
34+ with :
35+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
36+
37+ - name : Build and push Docker image
38+ id : push
39+ uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
40+ with :
41+ context : .
42+ push : true
43+ tags : ${{ steps.meta.outputs.tags }}
44+ labels : ${{ steps.meta.outputs.labels }}
1545
16- - name : Build Docker image
17- run : docker build -t webhook-router .
46+ - name : Generate artifact attestation
47+ uses : actions/attest-build-provenance@v3
48+ with :
49+ subject-name : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
50+ subject-digest : ${{ steps.push.outputs.digest }}
51+ push-to-registry : true
You can’t perform that action at this time.
0 commit comments