From 54e01bcbb53cb173d0ffaff46e437b6f397133cd Mon Sep 17 00:00:00 2001 From: Johan Bloemberg Date: Tue, 25 Feb 2025 15:27:10 +0100 Subject: [PATCH] [1.9.x] Also escape slash in cache image names (cherry picked from commit e39e8847c67fbe704a427a574492c533b34fc148) --- .github/workflows/docker.yml | 6 ++++-- documentation/Docker-deployment.md | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c94e3364a..52a0b423f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -80,6 +80,8 @@ jobs: scm_version=$(echo 'from setuptools_scm import get_version; print(get_version(version_scheme="release-branch-semver"))' | python) branch_version_suffix=${GITHUB_HEAD_REF:+-$GITHUB_HEAD_REF} echo "internetnl_version=$scm_version$branch_version_suffix" | tr '+' '-'| tr '/' '-' | tee -a "$GITHUB_OUTPUT" + # generate docker image tag used for PR specific caching and PR specific auto deploy + echo "github_ref_name_slug=${{github.ref_name}}" | tr '+' '-'| tr '/' '-' | tee -a "$GITHUB_OUTPUT" # login to pull images from Github registry - name: Login to GitHub Container Registry @@ -115,11 +117,11 @@ jobs: # and tag with PR source branch (eg: feature-x) tags: | ${{ env.DOCKER_REGISTRY }}/${{ matrix.image }}:${{ steps.get_version.outputs.internetnl_version }} - ${{ env.DOCKER_REGISTRY }}/${{ matrix.image }}:pr-${{ github.event_name == 'pull_request' && github.event.number || github.ref_name}} + ${{ env.DOCKER_REGISTRY }}/${{ matrix.image }}:${{ steps.get_version.outputs.github_ref_name_slug }} # use latest build from main, or image previously build by this PR for caching cache-from: | ${{ env.DOCKER_REGISTRY }}/${{ matrix.image }}:main - ${{ env.DOCKER_REGISTRY }}/${{ matrix.image }}:pr-${{ github.event_name == 'pull_request' && github.event.number || github.ref_name}} + ${{ env.DOCKER_REGISTRY }}/${{ matrix.image }}:${{ steps.get_version.outputs.github_ref_name_slug }} # push images to registry push: true # makes build images better usable as cache by allowing individual layers to be pulled from cache diff --git a/documentation/Docker-deployment.md b/documentation/Docker-deployment.md index aaf53b710..ecee8efff 100644 --- a/documentation/Docker-deployment.md +++ b/documentation/Docker-deployment.md @@ -276,7 +276,7 @@ This variable can be set to either of these values: - `latest`: update to latest stable release: https://github.com/internetstandards/Internet.nl/releases - `main`: update to latest release on the `main` branch -- `pr-`: update to the latest build of that Pull Request number +- `-merge`: update to the latest build of that Pull Request number Auto upgrades are performed by the `cron-docker` container/service. Progress/errors can be viewed by inspecting the container's logs: