Skip to content

Commit d53ed19

Browse files
committed
Add fix for branch names that are invalid docker tags.
1 parent 94ef670 commit d53ed19

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
build-docker-nextcloud:
2525
runs-on: ubuntu-latest
2626
steps:
27+
- name: Creat docker tag from git reference
28+
# A tag name may only contain lower- and uppercase letters, digits, underscores, periods and dashes.
29+
run: |
30+
echo "TAG=$(echo -n "${{ github.ref_name }}" | tr --complement --squeeze-repeats '[:alnum:]._-' '_')" >> "${GITHUB_ENV}"
31+
2732
- uses: actions/cache@v3
2833
id: cache-solid-nextcloud-docker
2934
with:
@@ -41,12 +46,12 @@ jobs:
4146
- name: Build Solid-Nextcloud Docker image
4247
run: |
4348
docker build \
44-
--tag "solid-nextcloud:${{ github.ref_name }}" \
45-
--tag "ghcr.io/pdsinterop/solid-nextcloud:${{ github.ref_name }}" \
49+
--tag "solid-nextcloud:${{ env.TAG }}" \
50+
--tag "ghcr.io/pdsinterop/solid-nextcloud:${{ env.TAG }}" \
4651
.
47-
docker push "ghcr.io/pdsinterop/solid-nextcloud:${{ github.ref_name }}"
52+
docker push "ghcr.io/pdsinterop/solid-nextcloud:${{ env.TAG }}"
4853
mkdir -p cache/solid-nextcloud
49-
docker image save solid-nextcloud:${{ github.ref_name }} --output ./cache/solid-nextcloud/${{ github.sha }}.tar
54+
docker image save solid-nextcloud:${{ env.TAG }} --output ./cache/solid-nextcloud/${{ github.sha }}.tar
5055
5156
solid-testsuite:
5257
strategy:
@@ -63,6 +68,11 @@ jobs:
6368
runs-on: ubuntu-latest
6469

6570
steps:
71+
- name: Creat docker tag from git reference
72+
# A tag name may only contain lower- and uppercase letters, digits, underscores, periods and dashes.
73+
run: |
74+
echo "TAG=$(echo -n "${{ github.ref_name }}" | tr --complement --squeeze-repeats '[:alnum:]._-' '_')" >> "${GITHUB_ENV}"
75+
6676
- uses: actions/checkout@v3
6777

6878
- uses: actions/cache@v3
@@ -95,8 +105,8 @@ jobs:
95105
"ghcr.io/pdsinterop/php-solid-pubsub-server:${{ env.PUBSUB_TAG }}"
96106
97107
source ./run-solid-test-suite.sh
98-
startSolidNextcloud 'server' "solid-nextcloud:${{ github.ref_name }}" ${{ matrix.test }}
99-
startSolidNextcloud 'thirdparty' "solid-nextcloud:${{ github.ref_name }}" ${{ matrix.test }}
108+
startSolidNextcloud 'server' "solid-nextcloud:${{ env.TAG }}" ${{ matrix.test }}
109+
startSolidNextcloud 'thirdparty' "solid-nextcloud:${{ env.TAG }}" ${{ matrix.test }}
100110
101111
echo "COOKIE_server=${COOKIE_server}" >> "${GITHUB_ENV}"
102112
echo "COOKIE_thirdparty=${COOKIE_thirdparty}" >> "${GITHUB_ENV}"

0 commit comments

Comments
 (0)