Skip to content

Commit e39e884

Browse files
aequitasmxsasha
authored andcommitted
Also escape slash in cache image names
1 parent 811ba44 commit e39e884

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.github/workflows/docker.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ jobs:
8484
scm_version=$(echo 'from setuptools_scm import get_version; print(get_version(version_scheme="release-branch-semver"))' | python)
8585
branch_version_suffix=${GITHUB_HEAD_REF:+-$GITHUB_HEAD_REF}
8686
echo "internetnl_version=$scm_version$branch_version_suffix" | tr '+' '-'| tr '/' '-' | tee -a "$GITHUB_OUTPUT"
87+
# generate docker image tag used for PR specific caching and PR specific auto deploy
88+
echo "github_ref_name_slug=${{github.ref_name}}" | tr '+' '-'| tr '/' '-' | tee -a "$GITHUB_OUTPUT"
8789
8890
# login to pull images from Github registry
8991
- name: Login to GitHub Container Registry
@@ -119,11 +121,11 @@ jobs:
119121
# and tag with PR source branch (eg: feature-x)
120122
tags: |
121123
${{ env.DOCKER_REGISTRY }}/${{ matrix.image }}:${{ steps.get_version.outputs.internetnl_version }}
122-
${{ env.DOCKER_REGISTRY }}/${{ matrix.image }}:pr-${{ github.event_name == 'pull_request' && github.event.number || github.ref_name}}
124+
${{ env.DOCKER_REGISTRY }}/${{ matrix.image }}:${{ steps.get_version.outputs.github_ref_name_slug }}
123125
# use latest build from main, or image previously build by this PR for caching
124126
cache-from: |
125127
${{ env.DOCKER_REGISTRY }}/${{ matrix.image }}:main
126-
${{ env.DOCKER_REGISTRY }}/${{ matrix.image }}:pr-${{ github.event_name == 'pull_request' && github.event.number || github.ref_name}}
128+
${{ env.DOCKER_REGISTRY }}/${{ matrix.image }}:${{ steps.get_version.outputs.github_ref_name_slug }}
127129
# push images to registry
128130
push: true
129131
# makes build images better usable as cache by allowing individual layers to be pulled from cache

documentation/Docker-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ This variable can be set to either of these values:
276276

277277
- `latest`: update to latest stable release: https://github.com/internetstandards/Internet.nl/releases
278278
- `main`: update to latest release on the `main` branch
279-
- `pr-<NUMBER>`: update to the latest build of that Pull Request number
279+
- `<NUMBER>-merge`: update to the latest build of that Pull Request number
280280

281281
Auto upgrades are performed by the `cron-docker` container/service. Progress/errors can be viewed by inspecting the container's logs:
282282

0 commit comments

Comments
 (0)