Skip to content

Commit 909987d

Browse files
Update Docker GHCR workflow and add image signing
Updated GitHub Actions workflow to use newer versions of actions and added image signing step.
1 parent 969e345 commit 909987d

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎.github/workflows/docker-ghcr.yml‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
permissions:
1111
contents: read
1212
packages: write
13+
id-token: write
1314

1415
env:
1516
REGISTRY: ghcr.io
@@ -21,7 +22,7 @@ jobs:
2122

2223
steps:
2324
- name: Checkout
24-
uses: actions/checkout@v4
25+
uses: actions/checkout@v5
2526

2627
- name: Login to GHCR
2728
uses: docker/login-action@v3
@@ -31,6 +32,7 @@ jobs:
3132
password: ${{ secrets.GITHUB_TOKEN }}
3233

3334
- name: Build and push Docker image
35+
id: build
3436
uses: docker/build-push-action@v6
3537
with:
3638
context: .
@@ -40,3 +42,13 @@ jobs:
4042
labels: |
4143
org.opencontainers.image.source=https://github.com/grandnode/grandnode2
4244
org.opencontainers.image.description=GrandNode GHCR private image test
45+
46+
- name: Install Cosign
47+
uses: sigstore/cosign-installer@v4.0.0
48+
49+
- name: Sign Docker image
50+
env:
51+
IMAGE: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
52+
DIGEST: ${{ steps.build.outputs.digest }}
53+
run: |
54+
cosign sign --yes "${IMAGE}@${DIGEST}"

0 commit comments

Comments
 (0)