Docs #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: Docs | |
| on: | |
| workflow_run: | |
| workflows: [CI] | |
| branches: [develop] | |
| types: [completed] | |
| workflow_dispatch: | |
| concurrency: | |
| group: pages-${{ github.event.workflow_run.head_branch || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| BUN_VERSION: "1.3.14" | |
| NODE_VERSION: "24.3.0" | |
| NPM_VERSION: "11.18.0" | |
| jobs: | |
| build: | |
| name: build production docs | |
| if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout green commit | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| ref: ${{ github.event.workflow_run.head_sha || github.sha }} | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 | |
| with: | |
| node-version: 24.3.0 | |
| - name: Install pinned npm | |
| run: | | |
| npm install --global npm@11.18.0 | |
| test "$(node --version)" = "v24.3.0" | |
| test "$(npm --version)" = "11.18.0" | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 | |
| with: | |
| bun-version: 1.3.14 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Install checksum-pinned wasm-pack | |
| run: bun scripts/install-wasm-pack.ts | |
| - name: Build exact production site | |
| run: | | |
| bun run build:packages | |
| bun run docs:generate | |
| bun run docs:check | |
| bun run --filter '@sheetwrite/docs-site' build | |
| bun test scripts/docs.test.ts | |
| - name: Install Chromium | |
| run: bun run browser:install | |
| - name: Smoke production routes and examples | |
| run: bun run test:browser | |
| - name: Configure Pages | |
| uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 | |
| with: | |
| path: docs/dist | |
| deploy: | |
| name: deploy production docs | |
| needs: build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Deploy Pages | |
| id: deployment | |
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 |