fix(docs): harden pages export runtime (#4) #18
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: Docs Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/pages.yml' | |
| - 'docs/**' | |
| - 'docs.json' | |
| - 'package.json' | |
| - 'scripts/docs-dev.mjs' | |
| - 'scripts/docs-static-compat.test.mjs' | |
| - 'scripts/export-docs-site.test.mjs' | |
| - 'scripts/export-docs-site.mjs' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| pages: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Configure Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Run docs export safety checks | |
| run: bun test scripts/docs-static-compat.test.mjs scripts/export-docs-site.test.mjs | |
| - name: Export static docs site | |
| run: node scripts/export-docs-site.mjs --output .pages-dist | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: .pages-dist | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |