Skip to content

Commit 08dd9e4

Browse files
committed
Try manual image name
1 parent 9547a81 commit 08dd9e4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/ci-pipeline.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
# Use docker.io for Docker Hub if empty
1616
REGISTRY: ghcr.io
1717
# github.repository as <account>/<repo>
18-
IMAGE_NAME: ${{ github.repository }}
18+
REGISTRY_PATH: ${{ github.repository }}
1919
TEST_TAG: user/app:test
2020

2121
jobs:
@@ -30,7 +30,7 @@ jobs:
3030
- name: Setup Docker buildx
3131
uses: docker/[email protected]
3232

33-
# Build but not push Docker image with Buildx
33+
# Build but don't push Docker image with Buildx
3434
# https://github.com/docker/build-push-action
3535
- name: Build test image
3636
id: build-test
@@ -65,6 +65,13 @@ jobs:
6565
- socketio_app
6666
- dramatiq_app
6767
steps:
68+
# GitHub gives only repository complete in <owner>/<repo> format.
69+
# Need some manual sheanigans
70+
# Set IMAGE_NAME so we can push to <owner>/<repo>/<image>
71+
- name: Set ENV variables
72+
run: |
73+
echo "IMAGE_NAME=${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/}" >> $GITHUB_ENV
74+
6875
- name: Checkout repository
6976
uses: actions/checkout@v4
7077

@@ -95,8 +102,9 @@ jobs:
95102
uses: docker/[email protected]
96103
with:
97104
# list of Docker images to use as base name for tags
105+
# <registry/<owner>/<repo_name>/<repo_name>-<target>
98106
images: |
99-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ env.IMAGE_NAME }}-${{ matrix.docker_target }}
107+
${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}-${{ matrix.docker_target }}
100108
# generate Docker tags based on the following events/attributes
101109
tags: |
102110
type=sha

0 commit comments

Comments
 (0)