Skip to content

Commit dd4be2f

Browse files
committed
ci(github-actions): Enable cosign for nightly builds
This patch adds a first PoC for cosign-signed container images. Cosign helps to authenticate the origin of a container image and is an important step towards supply chain integrity in the container ecosystem. This patch only introduces this change to nightly builds, in order to evaluate the changes before we utilise them for releases. Signed-off-by: Sheogorath <[email protected]>
1 parent 3a15ab9 commit dd4be2f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
jobs:
99
nightly:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
1114
strategy:
1215
matrix:
1316
base: [debian, alpine]
@@ -18,6 +21,11 @@ jobs:
1821
- name: Checkout
1922
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
2023

24+
- name: Install cosign
25+
uses: sigstore/cosign-installer@main
26+
with:
27+
cosign-release: 'v1.8.0'
28+
2129
- name: Set date
2230
run: echo TODAY=$(date +%Y%m%d) >> $GITHUB_ENV
2331

@@ -35,6 +43,7 @@ jobs:
3543
password: ${{ secrets.DOCKER_PASSWORD }}
3644

3745
- name: Build and push image
46+
id: build-push
3847
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # tag=v2
3948
with:
4049
context: .
@@ -47,3 +56,9 @@ jobs:
4756
tags: |
4857
${{ env.HEDGEDOC_IMAGE }}:${{ env.TODAY }}-${{ matrix.base }}
4958
${{ env.HEDGEDOC_IMAGE }}:${{ matrix.base }}
59+
60+
- name: Sign the images with GitHub OIDC Token
61+
run: cosign sign ${IMAGE}
62+
env:
63+
IMAGE: ${{ env.HEDGEDOC_IMAGE }}@${{ steps.build-push.outputs.digest }}
64+
COSIGN_EXPERIMENTAL: 1

0 commit comments

Comments
 (0)