Skip to content

Commit

Permalink
docs: add typedoc and github action to publish to pages
Browse files Browse the repository at this point in the history
  • Loading branch information
suhaotian committed Nov 15, 2024
1 parent df97446 commit 1897c34
Show file tree
Hide file tree
Showing 5 changed files with 462 additions and 13 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout
uses: actions/checkout@v4


- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'

- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false

- name: Install dependencies
run: pnpm install

- name: Generate docs
run: pnpm typedoc

- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './doc/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ plugins/
utils/
!src/utils
!src/tests/utils
!tests/src/tests/utils
!tests/src/tests/utils
doc
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
"promise-polyfill": "^8.3.0",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4",
"change-case": "^5.4.4"
"change-case": "^5.4.4",
"typedoc": "^0.26.11"
},
"prettier": {
"printWidth": 100,
Expand Down
Loading

0 comments on commit 1897c34

Please sign in to comment.