Deploy GitHub Pages #115
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy GitHub Pages | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| container: emscripten/emsdk:4.0.6 | |
| steps: | |
| - name: Install yarn | |
| run: npm install -g yarn | |
| - uses: actions/checkout@v4 | |
| - name: Cache dependencies | |
| id: cache-dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| pages/jquery | |
| pages/bootstrap | |
| pages/bootstrap-icons | |
| pages/bootstrap-multiselect | |
| pages/ngl | |
| # The hashed script contains the versions of the dependencies. | |
| key: ${{ hashFiles('pages/download_packages.sh') }} | |
| - name: Download dependencies | |
| if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
| run: $GITHUB_WORKSPACE/pages/download_packages.sh $GITHUB_WORKSPACE | |
| - name: Cache Ketcher | |
| id: cache-ketcher | |
| uses: actions/cache@v4 | |
| with: | |
| path: pages/ketcher | |
| key: ${{ hashFiles('ketcher/react-app/**/*') }} | |
| - name: Build Ketcher | |
| if: steps.cache-ketcher.outputs.cache-hit != 'true' | |
| shell: bash | |
| run: | | |
| source $GITHUB_WORKSPACE/pages/utils.sh | |
| build_ketcher $GITHUB_WORKSPACE | |
| - name: Cache WASM modules | |
| id: cache-wasm-modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| pages/inchi | |
| pages/rinchi | |
| key: ${{ hashFiles('pages/inchi_versions.json') }} | |
| - name: Build WASM modules | |
| if: steps.cache-wasm-modules.outputs.cache-hit != 'true' | |
| run: | | |
| apt-get update -y && apt-get install -y jq | |
| $GITHUB_WORKSPACE/pages/build_wasm_modules.sh $GITHUB_WORKSPACE | |
| - name: Test WASM modules | |
| if: steps.cache-wasm-modules.outputs.cache-hit != 'true' | |
| run: | | |
| cd $GITHUB_WORKSPACE/test | |
| yarn install | |
| yarn test | |
| - uses: actions/configure-pages@v5 | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| retention-days: 30 | |
| path: pages | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build-and-test | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |