Skip to content

Commit 603b27e

Browse files
committed
Push testing image to GHCR, sign GHCR images
1 parent ac29e6d commit 603b27e

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/docker-image-testing.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ jobs:
3636
username: ${{ secrets.DOCKERHUB_USERNAME }}
3737
password: ${{ secrets.DOCKERHUB_TOKEN }}
3838

39+
- name: Login to GitHub Container Registry
40+
uses: docker/login-action@v3
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
3946
- name: Build and push Docker image
4047
uses: docker/build-push-action@v5
4148
id: build-and-push
@@ -44,10 +51,20 @@ jobs:
4451
platforms: linux/amd64,linux/arm64
4552
push: true
4653
build-args: VERSION=testing-${{ github.sha }}
47-
tags: docker.io/wollomatic/socket-proxy:testing,docker.io/wollomatic/socket-proxy:testing-${{ github.sha }}
54+
tags: |
55+
docker.io/wollomatic/socket-proxy:testing
56+
docker.io/wollomatic/socket-proxy:testing-${{ github.sha }}
57+
ghcr.io/wollomatic/socket-proxy:testing
58+
ghcr.io/wollomatic/socket-proxy:testing-${{ github.sha }}
59+
60+
- name: Sign Docker Hub image
61+
run: cosign sign --yes --recursive --key env://COSIGN_PRIVATE_KEY docker.io/wollomatic/socket-proxy:testing-${{ github.sha }}@${{ steps.build-and-push.outputs.digest }}
62+
env:
63+
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
64+
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
4865

49-
- name: Sign images for all platforms
50-
run: cosign sign --yes --recursive --key env://COSIGN_PRIVATE_KEY docker.io/wollomatic/socket-proxy:${{ steps.get_tag.outputs.VERSION }}@${{ steps.build-and-push.outputs.digest }}
66+
- name: Sign GitHub Container Registry image
67+
run: cosign sign --yes --recursive --key env://COSIGN_PRIVATE_KEY ghcr.io/wollomatic/socket-proxy:testing-${{ github.sha }}@${{ steps.build-and-push.outputs.digest }}
5168
env:
5269
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
5370
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}

0 commit comments

Comments
 (0)