Skip to content

Commit db69648

Browse files
committed
Also push the Docker image to the GitHub Container Registry.
1 parent f177196 commit db69648

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/build-image.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
if [[ $GITHUB_REF =~ refs/tags/* ]]; then
6363
TAGS="$TAGS,${{ env.DOCKER_IMAGE_NAME }}:latest"
6464
fi
65+
TAGS="$TAGS,$(echo $TAGS | tr ',' '\n' | sed 's|^|ghcr.io/|' | tr '\n' ',')"
6566
# Determine the release type.
6667
if [[ $GITHUB_REF =~ refs/tags/* ]]; then
6768
IS_RELEASE=yes
@@ -106,6 +107,14 @@ jobs:
106107
username: ${{ secrets.DOCKERHUB_USERNAME }}
107108
password: ${{ secrets.DOCKERHUB_PASSWORD }}
108109

110+
- name: Login to GitHub Container Registry
111+
if: ${{ steps.prep.outputs.is_release == 'yes' }}
112+
uses: docker/login-action@v3
113+
with:
114+
registry: ghcr.io
115+
username: ${{ github.repository_owner }}
116+
password: ${{ secrets.GITHUB_TOKEN }}
117+
109118
- name: Build and push
110119
uses: docker/build-push-action@v6
111120
with:

0 commit comments

Comments
 (0)