Build and validate documentation #3
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: Documentation Build | |
| run-name: Build and validate documentation | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # Daily at 12 AM UTC | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| docs-build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [22] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| cache-dependency-path: 'docs/package-lock.json' | |
| - name: Cache node_modules | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 | |
| id: cache-node-modules | |
| with: | |
| path: docs/node_modules | |
| key: ${{ runner.os }}-node-${{ matrix.node-version }}-modules-${{ hashFiles('docs/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-${{ matrix.node-version }}-modules- | |
| - name: Install dependencies | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| working-directory: docs | |
| run: npm ci | |
| - name: Generate API documentation | |
| working-directory: docs | |
| run: npm run gen-api-docs all | |
| - name: Build documentation | |
| working-directory: docs | |
| run: npm run build | |
| - name: Upload build artifacts | |
| if: success() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: docs-build | |
| path: docs/build/ | |
| retention-days: 7 |