Upgrade CIs #205
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-doc | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # Review gh actions docs if you want to further define triggers, paths, etc | |
| # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build Docusaurus | |
| runs-on: ubuntu-latest | |
| env: | |
| OCAML_VERSION: "5.4" | |
| DUNE_VERSION: "3.22.0" | |
| DUNE_DIGEST: "sha256:33ca9308b48d9f5e90ee34f5b1045b53df6b5780a188556dab72af53621b5fba" | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| cache-dependency-path: doc/package-lock.json | |
| - name: Install Docusaurus Dependencies | |
| working-directory: ./doc | |
| run: npm ci --ignore-scripts | |
| - name: Environment setup | |
| run: | | |
| echo "DUNE_WORKSPACE=$PWD/dune-workspace.${{ env.OCAML_VERSION }}" >> "$GITHUB_ENV" | |
| - name: Setup Dune | |
| uses: mbarbin/setup-dune@03ede0220d3fe665f250727d8e21b7c0f9517f3b # v2.0.0+patch-7 | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| with: | |
| version: "${{ env.DUNE_VERSION }}" | |
| dune-digest: "${{ env.DUNE_DIGEST }}" | |
| workspace: "${{ env.DUNE_WORKSPACE }}" | |
| cache-prefix: "main-ci-${{ env.OCAML_VERSION }}" | |
| cache-readonly: true | |
| steps: install-dune enable-pkg lazy-update-depexts install-gpatch install-depexts | |
| - name: Build Odoc Pages | |
| run: dune build @doc | |
| - name: Copy Odoc Pages to Docusaurus Static Directory | |
| run: | | |
| rm -rf doc/static/odoc | |
| cp -R _build/default/_doc/_html doc/static/odoc | |
| - name: Build Website | |
| working-directory: ./doc | |
| run: npm run build | |
| - name: Upload Build Artifact | |
| uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 | |
| with: | |
| path: doc/build | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| needs: build | |
| # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| # Deploy to the github-pages environment | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./doc | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 |