name: Deploy API Docs # Generates TypeDoc API documentation and deploys it to GitHub Pages # using the official Pages deployment workflow (no gh-pages branch). # # Repository setting required: # Settings → Pages → Source: "GitHub Actions" # # Triggers: # - Automatically when a GitHub Release is published # - Manually via workflow_dispatch on: release: types: [published] workflow_dispatch: # Top-level permissions are read-only; write permissions are scoped to jobs. permissions: contents: read # Allow only one concurrent deployment, but do not cancel in-progress runs # (recommended by actions/deploy-pages so production deployments finish). concurrency: group: pages cancel-in-progress: false jobs: build: name: Build TypeDoc runs-on: ubuntu-latest permissions: contents: read steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Setup Node.js uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 with: node-version: 22 cache: npm - name: Install dependencies run: npm ci - name: Generate API docs run: npx typedoc # Prevent GitHub Pages from running Jekyll on the published artifact - name: Add .nojekyll run: touch docs/api/.nojekyll - name: Upload Pages artifact uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 with: path: docs/api deploy: name: Deploy to GitHub Pages needs: build runs-on: ubuntu-latest permissions: pages: write # Required to deploy to GitHub Pages id-token: write # Required for OIDC verification of the deployment environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0