File tree Expand file tree Collapse file tree 1 file changed +28
-8
lines changed Expand file tree Collapse file tree 1 file changed +28
-8
lines changed Original file line number Diff line number Diff line change 5
5
branches :
6
6
- main
7
7
8
+ permissions :
9
+ contents : read
10
+ packages : write
11
+ id-token : write
12
+
13
+
14
+ env :
15
+ REGISTRY : ghcr.io
16
+ IMAGE_NAME : ghcr.io/${{ github.repository }}
17
+
8
18
jobs :
9
19
docker :
10
20
runs-on : ubuntu-latest
@@ -14,18 +24,28 @@ jobs:
14
24
uses : actions/checkout@v4
15
25
16
26
- name : Setup Nix
17
- uses : cachix/install-nix-action@v27
27
+ uses : cachix/install-nix-action@v30
18
28
19
29
- name : Build Docker image
20
30
run : nix build .#docker
21
31
22
- - name : Log in to GitHub Container Registry
23
- run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
32
+ - name : Login to GitHub Container Registry
33
+ uses : docker/login-action@v3
34
+ with :
35
+ registry : ${{ env.REGISTRY }}
36
+ username : ${{ github.actor }}
37
+ password : ${{ secrets.GITHUB_TOKEN }}
24
38
25
- - name : Load Docker image
39
+ - name : Push Docker image to GitHub Container Registry
26
40
run : |
27
41
docker load < result
28
- docker tag drawbu.dev ghcr.io/${{ github.repository }}:latest
29
-
30
- - name : Push Docker image to GitHub Container Registry
31
- run : docker push ghcr.io/${{ github.repository }}:latest
42
+ docker tag drawbu.dev ${{ env.IMAGE_NAME }}
43
+ docker push ${{ env.IMAGE_NAME }}
44
+
45
+ - name : Attest
46
+ uses : actions/attest-build-provenance@v1
47
+ id : attest
48
+ with :
49
+ subject-name : ${{ 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