Skip to content

Commit 92af802

Browse files
committed
push to ghcr.io as the user who started the workflow
1 parent adea3c6 commit 92af802

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/build-images.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ jobs:
4848
id: docker_meta
4949
uses: docker/metadata-action@v5
5050
with:
51-
images: nutsfoundation/nuts-knooppunt
51+
# Set the registry to GHCR here
52+
images: ghcr.io/nutsfoundation/nuts-knooppunt
5253
tags: |
5354
# generate 'main' tag for the main branch
5455
type=ref,event=branch,enable={{is_default_branch}},prefix=
@@ -63,12 +64,14 @@ jobs:
6364
- name: Set up Docker Buildx
6465
uses: docker/setup-buildx-action@v3
6566

66-
- name: Login to Docker Hub
67+
- name: Login to Github container registry
6768
if: ${{ github.event_name != 'pull_request' }}
6869
uses: docker/login-action@v3
6970
with:
70-
username: ${{ secrets.DOCKERHUB_USERNAME }}
71-
password: ${{ secrets.DOCKERHUB_TOKEN }}
71+
# Authenticate as the user who started the workflow
72+
registry: ghcr.io
73+
username: ${{ github.actor }}
74+
password: ${{ secrets.GITHUB_TOKEN }}
7275

7376
- name: Build and push
7477
uses: docker/build-push-action@v6

0 commit comments

Comments
 (0)