From db00420716deab0e1edfbf72695dcd95e5d888b1 Mon Sep 17 00:00:00 2001 From: Alexander Krimm Date: Wed, 11 Sep 2024 09:57:50 +0200 Subject: [PATCH] CI: update github pages action versions This commit updates the github pages actions to versions which use supported nodejs versions and are generally up to date. This fixes all the warnings in the github actions panel. There is one change which broke the CI, as with the new versions uploading the same artifact name twice will not overwrite but create an error. This is fixed by only uploading the Release version. Also allows the special branch `fixOnlineDemo` to be used to test github pages deployment without having to merge the PR, by also publishing it to github pages. Signed-off-by: Alexander Krimm --- .github/workflows/build_cmake.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 4e7d5fa..0573215 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -107,26 +107,29 @@ jobs: run: cmake --build . --target opendigitizer_coverage - name: Setup Pages - uses: actions/configure-pages@v3 + if: matrix.cmake-build-type == 'Release' + uses: actions/configure-pages@v5 - name: "Fetch cors header workaround" # we're unable to set custom headers on github pages, workaround according to: https://stackoverflow.com/a/68675301 + if: matrix.cmake-build-type == 'Release' run: | npm i --save coi-serviceworker cp node_modules/coi-serviceworker/coi-serviceworker.js ../build/CMakeExternals/Build/ui-wasm/web/ sed -e "s%%%" -i ../build/CMakeExternals/Build/ui-wasm/web/index.html - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + if: matrix.cmake-build-type == 'Release' + uses: actions/upload-pages-artifact@v3 with: path: '../build/CMakeExternals/Build/ui-wasm/web/' deploy_pages: name: Deploy to GitHub Pages - if: ${{ github.ref_name == 'main' && github.event_name == 'push' }} + if: ${{ (github.ref_name == 'main' || github.ref_name == 'fixOnlineDemo') && github.event_name == 'push' }} environment: github-pages runs-on: ubuntu-latest needs: build steps: - name: "Setup Pages" - uses: actions/configure-pages@v3 + uses: actions/configure-pages@v5 - name: "Deploy to pages" id: deployment - uses: actions/deploy-pages@v2 + uses: actions/deploy-pages@v4