From 2c6fbb6f0e7470dc445eb1d56dc2d94fc5386164 Mon Sep 17 00:00:00 2001 From: jonathanrainer Date: Wed, 21 Aug 2024 12:51:26 +0100 Subject: [PATCH] Set namespaced registry properly --- .github/workflows/docker_publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml index 71f361b..110c99b 100644 --- a/.github/workflows/docker_publish.yml +++ b/.github/workflows/docker_publish.yml @@ -7,6 +7,7 @@ on: env: REGISTRY: ghcr.io + NAMESPACED_REGISTRY: ghcr.io/apollographql/ci-utility-docker-images jobs: calculate-images-to-build: @@ -31,7 +32,6 @@ jobs: echo "changed_dirs=$CHANGED_DIRS" >> "$GITHUB_OUTPUT" build-and-push-image: runs-on: ubuntu-latest - # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. permissions: contents: read packages: write @@ -58,8 +58,8 @@ jobs: echo "platforms=$(cat ${{ github.workspace }}/${{ matrix.changed_dir }}/config.yml | yq '.platforms | join(",")')" >> "$GITHUB_OUTPUT" - name: Check Image to Build Does Not Already Exist run: | - if docker manifest inspect ${{ env.REGISTRY }}/${{ matrix.changed_dir }}:${{ steps.extract_from_config_yaml.outputs.desired_version }} > /dev/null; then - echo "The tag "${{ env.REGISTRY }}/${{ matrix.changed_dir }}:${{ steps.extract_from_config_yaml.outputs.desired_version }}" already exists in the repository. Do you need to bump the version in the config.yml?" + if docker manifest inspect ${{ env.NAMESPACED_REGISTRY }}/${{ matrix.changed_dir }}:${{ steps.extract_from_config_yaml.outputs.desired_version }} > /dev/null; then + echo "The tag "${{ env.NAMESPACED_REGISTRY }}/${{ matrix.changed_dir }}:${{ steps.extract_from_config_yaml.outputs.desired_version }}" already exists in the repository. Do you need to bump the version in the config.yml?" exit 1 fi - name: Calculate Version @@ -73,7 +73,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ matrix.changed_dir }} + images: ${{ env.NAMESPACED_REGISTRY }}/${{ matrix.changed_dir }} tags: | type=semver,pattern={{version}},value=v${{ steps.calculate_version.outputs.version }} type=sha