Skip to content

Commit

Permalink
auto generate docs and deploy to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mameta committed Dec 5, 2024
1 parent 4631d65 commit 609dd89
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 2 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: deploy documentation

on:
push:
branches: ['develop']
paths:
- 'docs/**'
- 'packages/*/src/**'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: 'pages'
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.12.0'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Format documentation
run: |
yarn run format docs
yarn workspace @jpyc/sdk-core run format
- name: Generate documentation
run: |
echo "Generating documentation..."
set -x
yarn docs || {
echo "Documentation generation failed"
exit 1
}
- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs/core-html'

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions packages/core/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ cache
artifacts
node_modules
JPYCv2
docs/core-html/
4 changes: 3 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"lint:dry-run": "eslint ./src",
"format": "prettier --write .",
"format:dry-run": "prettier --check .",
"docs": "typedoc"
"docs": "yarn docs:md && yarn docs:html",
"docs:md": "typedoc --plugin typedoc-plugin-markdown --out ../../docs/core",
"docs:html": "typedoc --out ../../docs/core-html"
},
"dependencies": {
"dotenv": "^16.4.6",
Expand Down
1 change: 0 additions & 1 deletion typedoc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"plugin": ["typedoc-plugin-markdown"],
"cleanOutputDir": false
}

0 comments on commit 609dd89

Please sign in to comment.