Skip to content

Deploy API Docs

Deploy API Docs #1465

Workflow file for this run

name: Deploy API Docs
on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]
workflow_dispatch:
permissions: {}
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
# workflow_dispatch bypasses CI gate (intentional for emergency redeploys, restricted to main)
if: >-
(github.event_name == 'workflow_dispatch' &&
github.ref == 'refs/heads/main') ||
github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
cache: npm
- run: npm ci
# tsx is not in root devDependencies; install it directly in the
# workspace's node_modules instead of relying on npx auto-download,
# which has been unreliable on the CI runner.
- run: npm install --no-save tsx@4.22.1
- run: ./node_modules/.bin/tsx scripts/generate-function-lookup.ts
- run: npm run docs:api
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: docs-api
deploy:
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0