Skip to content

Commit

Permalink
CI: update github pages action versions
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
wirew0rm committed Sep 11, 2024
1 parent 88b69dd commit 7352039
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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%</style>%</style><script src=\"coi-serviceworker.js\"></script>%" -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

0 comments on commit 7352039

Please sign in to comment.