name: Docs CI on: push: branches: [main] paths: - 'docs/**' - 'frontend/public/openapi.json' - 'frontend/src/pages/api-docs/endpoints.ts' - '.github/workflows/docs-ci.yml' pull_request: paths: - 'docs/**' - 'frontend/public/openapi.json' - 'frontend/src/pages/api-docs/endpoints.ts' - '.github/workflows/docs-ci.yml' permissions: contents: read defaults: run: working-directory: docs jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: pnpm/action-setup@v6 with: package_json_file: docs/package.json - uses: actions/setup-node@v7 with: node-version-file: .nvmrc cache: pnpm cache-dependency-path: docs/pnpm-lock.yaml - run: pnpm install --frozen-lockfile - name: Typecheck run: pnpm typecheck - name: Lint run: pnpm lint - name: Format check run: pnpm format:check - name: Test run: pnpm test # The API reference is generated from the panel's own spec. The copy into # docs/public and the generated pages both have to be in step with it. - name: The docs spec must be the panel's run: cmp frontend/public/openapi.json docs/public/openapi.json working-directory: . - name: Regenerate the API reference run: pnpm gen:api - name: Fail if the generated API reference is stale run: git diff --exit-code -- docs/content/docs/en/reference/api working-directory: . - name: Build run: pnpm build