v0.2.5 #52
Workflow file for this run
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
| # ┌─────────────────────────────────────────────────────────────────────┐ | |
| # │ Generate API docs from source and push them to the semos │ | |
| # │ website repo via repository_dispatch. │ | |
| # │ │ | |
| # │ Requirements: │ | |
| # │ - A repo secret SEMOS_DOCS_TOKEN (a GitHub PAT with repo scope │ | |
| # │ that can dispatch events to semos-labs/semos) │ | |
| # │ - typedoc + typedoc-plugin-markdown as dev dependencies │ | |
| # │ - A typedoc.json config in the repo root │ | |
| # └─────────────────────────────────────────────────────────────────────┘ | |
| name: Push Docs to Website | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| generate-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Generate docs with TypeDoc | |
| run: bunx typedoc | |
| - name: Post-process for Starlight | |
| run: bun scripts/postprocess-docs.ts .docs-out | |
| - name: Package docs | |
| run: tar -czf docs.tar.gz -C .docs-out . | |
| - name: Upload docs artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: glyph-docs | |
| path: docs.tar.gz | |
| retention-days: 3 | |
| - name: Notify website repo | |
| uses: actions/github-script@v7 | |
| env: | |
| PRODUCT_NAME: glyph | |
| with: | |
| github-token: ${{ secrets.SEMOS_DOCS_TOKEN }} | |
| script: | | |
| await github.rest.repos.createDispatchEvent({ | |
| owner: 'semos-labs', | |
| repo: 'semos', | |
| event_type: 'docs-update', | |
| client_payload: { | |
| product: process.env.PRODUCT_NAME, | |
| run_id: String(context.runId), | |
| repository: `${context.repo.owner}/${context.repo.repo}`, | |
| sha: context.sha, | |
| }, | |
| }); | |
| console.log(`Dispatched docs-update to semos-labs/semos (run ${context.runId})`); |