File tree Expand file tree Collapse file tree 1 file changed +41
-3
lines changed
Expand file tree Collapse file tree 1 file changed +41
-3
lines changed Original file line number Diff line number Diff line change 66 pull_request :
77 branches : [ "main" ]
88
9+ env :
10+ REGISTRY : ghcr.io
11+ IMAGE_NAME : a3d3-institute/hdr-image
12+
913jobs :
1014
1115 build :
1216
1317 runs-on : ubuntu-24.04
1418
19+ permissions :
20+ contents : read
21+ packages : write
22+ attestations : write
23+ id-token : write
24+
1525 steps :
1626 - name : Remove unnecessary files
1727 run : |
1828 sudo rm -rf /usr/share/dotnet
1929 sudo rm -rf "$AGENT_TOOLSDIRECTORY"
20- - uses : actions/checkout@v4
21- - name : Build the Docker image
22- run : docker build . --file Dockerfile --tag hdr-image:$(date +%s)
30+ - name : Checkout repository
31+ uses : actions/checkout@v4
32+
33+ - name : Log in to the Container registry
34+ uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
35+ with :
36+ registry : ${{ env.REGISTRY }}
37+ username : ${{ github.actor }}
38+ password : ${{ secrets.GITHUB_TOKEN }}
39+
40+ - name : Extract metadata (tags, labels) for Docker
41+ id : meta
42+ uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
43+ with :
44+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
45+
46+ - name : Build and push Docker image
47+ id : push
48+ uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
49+ with :
50+ context : .
51+ push : true
52+ tags : ${{ steps.meta.outputs.tags }}
53+ labels : ${{ steps.meta.outputs.labels }}
54+
55+ - name : Generate artifact attestation
56+ uses : actions/attest-build-provenance@v2
57+ with :
58+ subject-name : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
59+ subject-digest : ${{ steps.push.outputs.digest }}
60+ push-to-registry : true
You can’t perform that action at this time.
0 commit comments