Skip to content

Commit 7e84a15

Browse files
committed
github/workflows: Sign Arch & Ubuntu images with cosign
Signed-off-by: Timothée Ravier <[email protected]>
1 parent 492d627 commit 7e84a15

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/workflows/arch-images.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,22 @@ jobs:
6262
image: ${{ env.distro }}-toolbox
6363
registry: ${{ env.registry }}
6464
tags: latest
65+
66+
- name: Login to Container Registry
67+
uses: redhat-actions/podman-login@v1
68+
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
69+
with:
70+
registry: ${{ env.registry }}
71+
username: ${{ env.username }}
72+
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
73+
74+
- uses: sigstore/[email protected]
75+
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
76+
77+
- name: Sign container image (latest)
78+
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
79+
run: |
80+
cosign sign -y --recursive --key env://COSIGN_PRIVATE_KEY ${{ env.registry }}/${{ env.distro }}-toolbox@${{ steps.push-latest.outputs.digest }}
81+
env:
82+
COSIGN_EXPERIMENTAL: false
83+
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}

.github/workflows/ubuntu-images.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,30 @@ jobs:
9494
image: ${{ env.distro }}-toolbox
9595
registry: ${{ env.registry }}
9696
tags: ${{ matrix.release }} latest
97+
98+
- name: Login to Container Registry
99+
uses: redhat-actions/podman-login@v1
100+
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
101+
with:
102+
registry: ${{ env.registry }}
103+
username: ${{ env.username }}
104+
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
105+
106+
- uses: sigstore/[email protected]
107+
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
108+
109+
- name: Sign container image
110+
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' && env.latest_release != matrix.release
111+
run: |
112+
cosign sign -y --recursive --key env://COSIGN_PRIVATE_KEY ${{ env.registry }}/${{ env.distro }}-toolbox@${{ steps.push.outputs.digest }}
113+
env:
114+
COSIGN_EXPERIMENTAL: false
115+
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
116+
117+
- name: Sign container image (latest)
118+
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' && env.latest_release == matrix.release
119+
run: |
120+
cosign sign -y --recursive --key env://COSIGN_PRIVATE_KEY ${{ env.registry }}/${{ env.distro }}-toolbox@${{ steps.push-latest.outputs.digest }}
121+
env:
122+
COSIGN_EXPERIMENTAL: false
123+
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}

0 commit comments

Comments
 (0)