From 3b359478852475741e5686db1234dd864e083726 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:36:53 +0800 Subject: [PATCH 1/4] Update config-shim to v1.1.0 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 521727e..9ab0709 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,7 +47,7 @@ COPY dockerbuild/config/* $SSP_PATH/config/ COPY dockerbuild/ssp-overrides/sp-php.patch sp-php.patch RUN patch /data/vendor/simplesamlphp/simplesamlphp/modules/saml/src/Auth/Source/SP.php sp-php.patch -ADD https://github.com/silinternational/config-shim/releases/download/v1.0.0/config-shim.gz config-shim.gz +ADD https://github.com/silinternational/config-shim/releases/download/v1.1.0/config-shim.gz config-shim.gz RUN gzip -d config-shim.gz && chmod 755 config-shim && mv config-shim /usr/local/bin # Set permissions for cache directory. Corresponds to the `cachedir` setting in config.php. From d3bb0542fb7cd74174e62c11d42f50b6b5a24170 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:37:21 +0800 Subject: [PATCH 2/4] push image on feature branches --- .github/workflows/test-and-publish.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-and-publish.yml b/.github/workflows/test-and-publish.yml index 7c2ddec..5453589 100644 --- a/.github/workflows/test-and-publish.yml +++ b/.github/workflows/test-and-publish.yml @@ -2,8 +2,6 @@ name: Test and Publish on: push: - branches: [ 'main' ] #Triger on the main branch - tags: [ '[0-9]+.[0-9]+.[0-9]+' ] # Trigger on version tags like '0.1.0' jobs: tests: @@ -39,10 +37,11 @@ jobs: - name: Log in to GitHub Container Registry uses: docker/login-action@v3 + if: startsWith(github.ref, 'refs/tags') with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta @@ -55,7 +54,7 @@ jobs: type=ref,event=branch type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - + - name: Build and push Docker image uses: docker/build-push-action@v5 with: From 140fa0d40a6a9b5e48252d6bc017a7c5f8fdf530 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:05:56 +0800 Subject: [PATCH 3/4] add the -u and --strategy flags to config-shim --- .github/workflows/test-and-publish.yml | 11 ++++++++++- dockerbuild/run.sh | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-and-publish.yml b/.github/workflows/test-and-publish.yml index 5453589..0809bc6 100644 --- a/.github/workflows/test-and-publish.yml +++ b/.github/workflows/test-and-publish.yml @@ -55,10 +55,19 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - - name: Build and push Docker image + - name: Build and push Docker image to Docker Hub uses: docker/build-push-action@v5 with: context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + + - name: Build and push Docker image to GitHub Container Registry + uses: docker/build-push-action@v5 + if: startsWith(github.ref, 'refs/tags') + with: + context: . + push: true + tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/dockerbuild/run.sh b/dockerbuild/run.sh index d3c5dc6..11808c7 100755 --- a/dockerbuild/run.sh +++ b/dockerbuild/run.sh @@ -23,7 +23,7 @@ php -v | head -n 1 if [[ -z "${APP_ID}" ]]; then apache2ctl -k start -D FOREGROUND else - config-shim --app $APP_ID --config $CONFIG_ID --env $ENV_ID apache2ctl -k start -D FOREGROUND + config-shim -u --strategy $STRATEGY_ID --app $APP_ID --config $CONFIG_ID --env $ENV_ID apache2ctl -k start -D FOREGROUND fi # endless loop with a wait is needed for the trap to work From 28d3dd0d2448f3f06fc0614cae414d51c553e679 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:10:55 +0800 Subject: [PATCH 4/4] fix deployment workflow --- .github/workflows/test-and-publish.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test-and-publish.yml b/.github/workflows/test-and-publish.yml index 0809bc6..7cdf8d8 100644 --- a/.github/workflows/test-and-publish.yml +++ b/.github/workflows/test-and-publish.yml @@ -47,9 +47,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: | - ${{ vars.DOCKER_ORG }}/${{ github.event.repository.name }} - ghcr.io/${{ github.repository }} + images: ${{ vars.DOCKER_ORG }}/${{ github.event.repository.name }} tags: | type=ref,event=branch type=semver,pattern={{version}}