[CI] Feature: Deploy typedoc to permalink #9
Workflow file for this run
This file contains 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: TypeDoc | |
on: | |
pull_request: | |
types: [opened, edited, reopened, synchronize] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: "Generate TypeDoc" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Install | |
uses: ./.github/composite-actions/install | |
- name: Generate Documentation | |
run: pnpm typedoc | |
- name: Update Gist | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const fs = require('fs'); | |
const content = fs.readFileSync('./typedoc/documentation.json', 'utf8'); | |
const gistId = 'your-gist-id'; | |
await github.rest.gists.update({ | |
gist_id: gistId, | |
files: { | |
'data.json': { | |
content: content | |
} | |
} | |
}); | |
console.log(`Permalink: https://gist.githubusercontent.com/raw/${gistId}/data.json`); |