Skip to content

Commit

Permalink
[1.9.x] Also escape slash in cache image names
Browse files Browse the repository at this point in the history
(cherry picked from commit e39e884)
  • Loading branch information
aequitas authored and mxsasha committed Mar 4, 2025
1 parent ec943ab commit 54e01bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion documentation/Docker-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<NUMBER>`: update to the latest build of that Pull Request number
- `<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:

Expand Down

0 comments on commit 54e01bc

Please sign in to comment.