WIP Upgrade Docs to Docusaurus #4
Workflow file for this run
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: Build and Deploy Docs v2 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: '20' | |
| - name: Install root dependencies | |
| run: npm ci | |
| - name: Install docs dependencies | |
| run: npm ci | |
| working-directory: docs | |
| - name: Build docs | |
| run: npm run build | |
| working-directory: docs | |
| - name: Validate links and anchors | |
| # Docusaurus baseUrl is /javascript/, so all internal links are emitted | |
| # as /javascript/... . hyperlink treats the given dir as server root "/", | |
| # so the build must be staged under a matching javascript/ subdirectory | |
| # for site-absolute links to resolve. | |
| run: | | |
| rm -rf _linkcheck | |
| mkdir -p _linkcheck/javascript | |
| cp -R docs/build/. _linkcheck/javascript/ | |
| npx @untitaker/hyperlink _linkcheck --check-anchors | |
| - name: Deploy to gh-pages | |
| if: github.event_name == 'push' | |
| uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0 | |
| with: | |
| branch: gh-pages | |
| folder: docs/build |