File tree 11 files changed +95
-42
lines changed
11 files changed +95
-42
lines changed Original file line number Diff line number Diff line change 8
8
9
9
jobs :
10
10
build :
11
-
12
11
runs-on : ubuntu-latest
13
12
permissions :
14
13
contents : read
@@ -41,23 +40,25 @@ jobs:
41
40
uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
42
41
with :
43
42
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
43
+ tags : |
44
+ type=raw,value=latest
45
+ type=raw,value=daily
44
46
45
47
- name : Build and push Docker image
46
48
id : build-and-push
47
49
uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
48
50
with :
49
51
context : .
50
52
push : ${{ github.event_name != 'pull_request' }}
51
- tags : ghcr.io/ ${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:daily
53
+ tags : ${{ steps.meta.outputs.tags }}
52
54
labels : ${{ steps.meta.outputs.labels }}
53
55
cache-from : type=gha
54
56
cache-to : type=gha,mode=max
55
57
56
-
57
58
- name : Sign the published Docker image
58
59
env :
60
+ TAGS : ${{ steps.meta.outputs.tags }}
59
61
DIGEST : ${{ steps.build-and-push.outputs.digest }}
60
62
run : |
61
63
cosign version
62
- echo "ghcr.io/${{ github.repository }}:daily" | xargs -I {} cosign sign --yes {}@${DIGEST}
63
- echo "ghcr.io/${{ github.repository }}:latest" | xargs -I {} cosign sign --yes {}@${DIGEST}
64
+ echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
Original file line number Diff line number Diff line change 8
8
9
9
jobs :
10
10
build :
11
-
12
11
runs-on : ubuntu-latest
13
12
permissions :
14
13
contents : read
@@ -37,20 +36,22 @@ jobs:
37
36
uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
38
37
with :
39
38
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39
+ tags : |
40
+ type=raw,value=static
40
41
41
42
- name : Build and push Docker image
42
43
id : build-and-push
43
44
uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
44
45
with :
45
46
push : true
46
- tags : ghcr.io/ ${{ github.repository }}:static
47
+ tags : ${{ steps.meta.outputs.tags }}
47
48
context : .
48
- file : Dockerfile.static
49
-
49
+ file : Dockerfile.static
50
50
51
51
- name : Sign the published Docker image
52
52
env :
53
+ TAGS : ${{ steps.meta.outputs.tags }}
53
54
DIGEST : ${{ steps.build-and-push.outputs.digest }}
54
55
run : |
55
56
cosign version
56
- echo "ghcr.io/${{ github.repository }}:static " | xargs -I {} cosign sign --yes {}@${DIGEST}
57
+ echo "${TAGS} " | xargs -I {} cosign sign --yes {}@${DIGEST}
Original file line number Diff line number Diff line change 8
8
9
9
jobs :
10
10
build :
11
-
12
11
runs-on : ubuntu-latest
13
12
permissions :
14
13
contents : read
@@ -37,20 +36,22 @@ jobs:
37
36
uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
38
37
with :
39
38
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39
+ tags : |
40
+ type=raw,value=static
40
41
41
42
- name : Build and push Docker image
42
43
id : build-and-push
43
44
uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
44
45
with :
45
46
push : true
46
- tags : ghcr.io/ ${{ github.repository }}:static
47
+ tags : ${{ steps.meta.outputs.tags }}
47
48
context : .
48
- file : Dockerfile.static
49
-
49
+ file : Dockerfile.static
50
50
51
51
- name : Sign the published Docker image
52
52
env :
53
+ TAGS : ${{ steps.meta.outputs.tags }}
53
54
DIGEST : ${{ steps.build-and-push.outputs.digest }}
54
55
run : |
55
56
cosign version
56
- echo "ghcr.io/${{ github.repository }}:static " | xargs -I {} cosign sign --yes {}@${DIGEST}
57
+ echo "${TAGS} " | xargs -I {} cosign sign --yes {}@${DIGEST}
Original file line number Diff line number Diff line change 8
8
9
9
jobs :
10
10
build :
11
-
12
11
runs-on : ubuntu-latest
13
12
permissions :
14
13
contents : read
@@ -37,23 +36,25 @@ jobs:
37
36
uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
38
37
with :
39
38
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39
+ tags : |
40
+ type=raw,value=latest
41
+ type=raw,value=daily
40
42
41
43
- name : Build and push Docker image
42
44
id : build-and-push
43
45
uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
44
46
with :
45
47
context : .
46
48
push : ${{ github.event_name != 'pull_request' }}
47
- tags : ghcr.io/ ${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:daily
49
+ tags : ${{ steps.meta.outputs.tags }}
48
50
labels : ${{ steps.meta.outputs.labels }}
49
51
cache-from : type=gha
50
52
cache-to : type=gha,mode=max
51
53
52
-
53
54
- name : Sign the published Docker image
54
55
env :
56
+ TAGS : ${{ steps.meta.outputs.tags }}
55
57
DIGEST : ${{ steps.build-and-push.outputs.digest }}
56
58
run : |
57
59
cosign version
58
- echo "ghcr.io/${{ github.repository }}:daily" | xargs -I {} cosign sign --yes {}@${DIGEST}
59
- echo "ghcr.io/${{ github.repository }}:latest" | xargs -I {} cosign sign --yes {}@${DIGEST}
60
+ echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ name: image-signed-ghat(latest)-malicious
2
2
on :
3
3
workflow_dispatch :
4
4
5
+ env :
6
+ REGISTRY : ghcr.io
7
+ IMAGE_NAME : ${{ github.repository }}
8
+
5
9
jobs :
6
10
build :
7
11
runs-on : ubuntu-latest
16
20
uses : actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
17
21
18
22
- name : The malicious step
23
+ env :
24
+ IMAGE_NAME : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
19
25
run : |
20
26
make build-malicious-image
21
27
@@ -26,16 +32,25 @@ jobs:
26
32
username : ${{ github.actor }}
27
33
password : ${{ secrets.GITHUB_TOKEN }}
28
34
35
+ - name : Extract Docker metadata
36
+ id : meta
37
+ uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
38
+ with :
39
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
40
+ tags : |
41
+ type=raw,value=latest
42
+
29
43
- name : Build and push image
30
44
id : push-step
31
45
uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
32
46
with :
33
47
push : true
34
- tags : ghcr.io/ ${{ github.repository }}:latest
48
+ tags : ${{ steps.meta.outputs.tags }}
35
49
context : .
36
50
37
51
- name : Attest image
38
52
39
53
with :
40
54
subject-name : ghcr.io/${{ github.repository }}
41
55
subject-digest : ${{ steps.push-step.outputs.digest }}
56
+ push-to-registry : true
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ name: image-signed-ghat(static)-copied
2
2
on :
3
3
workflow_dispatch :
4
4
5
+ env :
6
+ REGISTRY : ghcr.io
7
+ IMAGE_NAME : ${{ github.repository }}
8
+
5
9
jobs :
6
10
build :
7
11
runs-on : ubuntu-latest
@@ -22,17 +26,26 @@ jobs:
22
26
username : ${{ github.actor }}
23
27
password : ${{ secrets.GITHUB_TOKEN }}
24
28
29
+ - name : Extract Docker metadata
30
+ id : meta
31
+ uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
32
+ with :
33
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
34
+ tags : |
35
+ type=raw,value=static
36
+
25
37
- name : Build and push image
26
38
id : push-step
27
39
uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
28
40
with :
29
41
push : true
30
- tags : ghcr.io/ ${{ github.repository }}:static
42
+ tags : ${{ steps.meta.outputs.tags }}
31
43
context : .
32
- file : Dockerfile.static
44
+ file : Dockerfile.static
33
45
34
46
- name : Attest image
35
47
36
48
with :
37
49
subject-name : ghcr.io/${{ github.repository }}
38
50
subject-digest : ${{ steps.push-step.outputs.digest }}
51
+ push-to-registry : true
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ name: image-signed-ghat(static)
2
2
on :
3
3
workflow_dispatch :
4
4
5
+ env :
6
+ REGISTRY : ghcr.io
7
+ IMAGE_NAME : ${{ github.repository }}
8
+
5
9
jobs :
6
10
build :
7
11
runs-on : ubuntu-latest
@@ -22,17 +26,26 @@ jobs:
22
26
username : ${{ github.actor }}
23
27
password : ${{ secrets.GITHUB_TOKEN }}
24
28
29
+ - name : Extract Docker metadata
30
+ id : meta
31
+ uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
32
+ with :
33
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
34
+ tags : |
35
+ type=raw,value=static
36
+
25
37
- name : Build and push image
26
38
id : push-step
27
39
uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
28
40
with :
29
41
push : true
30
- tags : ghcr.io/ ${{ github.repository }}:static
42
+ tags : ${{ steps.meta.outputs.tags }}
31
43
context : .
32
- file : Dockerfile.static
44
+ file : Dockerfile.static
33
45
34
46
- name : Attest image
35
47
36
48
with :
37
49
subject-name : ghcr.io/${{ github.repository }}
38
50
subject-digest : ${{ steps.push-step.outputs.digest }}
51
+ push-to-registry : true
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ name: image-signed-ghat(latest)
2
2
on :
3
3
workflow_dispatch :
4
4
5
+ env :
6
+ REGISTRY : ghcr.io
7
+ IMAGE_NAME : ${{ github.repository }}
8
+
5
9
jobs :
6
10
build :
7
11
runs-on : ubuntu-latest
@@ -22,16 +26,25 @@ jobs:
22
26
username : ${{ github.actor }}
23
27
password : ${{ secrets.GITHUB_TOKEN }}
24
28
29
+ - name : Extract Docker metadata
30
+ id : meta
31
+ uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
32
+ with :
33
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
34
+ tags : |
35
+ type=raw,value=latest
36
+
25
37
- name : Build and push image
26
38
id : push-step
27
39
uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
28
40
with :
29
41
push : true
30
- tags : ghcr.io/ ${{ github.repository }}:latest
42
+ tags : ${{ steps.meta.outputs.tags }}
31
43
context : .
32
44
33
45
- name : Attest image
34
46
35
47
with :
36
48
subject-name : ghcr.io/${{ github.repository }}
37
49
subject-digest : ${{ steps.push-step.outputs.digest }}
50
+ push-to-registry : true
Original file line number Diff line number Diff line change 8
8
9
9
jobs :
10
10
build :
11
-
12
11
runs-on : ubuntu-latest
13
12
permissions :
14
13
contents : read
19
18
- name : Checkout repository
20
19
uses : actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
21
20
22
- # - name: Install Cosign
23
- # uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
24
- # with:
25
- # cosign-release: 'v2.1.1'
26
-
27
21
- name : Setup Docker buildx
28
22
uses : docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
29
23
@@ -39,21 +33,17 @@ jobs:
39
33
uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
40
34
with :
41
35
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
36
+ tags : |
37
+ type=raw,value=latest
38
+ type=raw,value=daily
42
39
43
40
- name : Build and push Docker image
44
41
id : build-and-push
45
42
uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
46
43
with :
47
44
context : .
48
45
push : ${{ github.event_name != 'pull_request' }}
49
- tags : ghcr.io/ ${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:daily
46
+ tags : ${{ steps.meta.outputs.tags }}
50
47
labels : ${{ steps.meta.outputs.labels }}
51
48
cache-from : type=gha
52
49
cache-to : type=gha,mode=max
53
-
54
- # - name: Sign the published Docker image
55
- # env:
56
- # DIGEST: ${{ steps.build-and-push.outputs.digest }}
57
- # run: |
58
- # echo "ghcr.io/${{ github.repository }}:daily" | xargs -I {} cosign sign --yes {}@${DIGEST}
59
- # echo "ghcr.io/${{ github.repository }}:latest" | xargs -I {} cosign sign --yes {}@${DIGEST}
Original file line number Diff line number Diff line change 1
1
# Replace this with your image name, i.e. ghcr.io/<your-username>/demo-repo-go:latest
2
2
IMAGE_NAME? =ghcr.io/stacklok/demo-repo-go:latest
3
3
4
+ # Lowercase the image name to handle mixed-case GitHub org/repo names
5
+ IMAGE_NAME := $(shell echo $(IMAGE_NAME ) | tr '[:upper:]' '[:lower:]')
6
+
4
7
# Replace this with your GitHub username and PAT.
5
8
# This is used to authenticate with GitHub Container Registry (GHCR)
6
9
# and push the image to your repository.
You can’t perform that action at this time.
0 commit comments