Skip to content

Commit

Permalink
Generate docs with TBDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
leordev committed Dec 14, 2023
1 parent edc8054 commit 1ad8018
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
node-version: 18
registry-url: https://registry.npmjs.org/
cache: 'npm'
cache: "npm"

- name: Install dependencies
run: npm ci
Expand All @@ -41,7 +41,7 @@ jobs:
entry_points: |
- file: packages/api/src/index.ts
docsReporter: api-extractor
docsGenerator: typedoc-markdown
docsGenerator: typedoc-html
- name: Save Artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
Expand Down
108 changes: 56 additions & 52 deletions .github/workflows/docs-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,62 +32,66 @@ jobs:
with:
node-version: 18
registry-url: https://registry.npmjs.org/
cache: 'npm'
cache: "npm"

- name: Install dependencies
run: |
npm ci
npm i jsdoc
npm i clean-jsdoc-theme
- name: Generate documentation
run: |
echo "# Web5 JS SDK" > README-docs.md
echo "Select from the menu on the left to view API reference documentation." >> README-docs.md
npx jsdoc -c jsdoc.json
curl -o docs/favicon.ico https://developer.tbd.website/img/favicon.ico
run: npm ci

- name: Upload documentation artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
with:
name: jsdoc
path: ./docs

deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: read # to read from project repo
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- name: Build all workspace packages
run: npm run build

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Download JSDoc artifacts
uses: actions/download-artifact@v3
- name: TBDocs Reporter
id: tbdocs-reporter-protocol
uses: TBD54566975/tbdocs@leordev/gh-pages-html
with:
name: jsdoc
path: ./docs
token: ${{ secrets.GITHUB_TOKEN }}
fail_on_error: true
entry_points: |
- file: packages/api/src/index.ts
docsReporter: api-extractor
docsGenerator: typedoc-html
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
- name: Upload documentation artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
with:
path: "./docs"

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
name: web5-api-docs
path: ./packages/api/.tbdocs/docs

# deploy:
# # Add a dependency to the build job
# needs: build

# # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
# permissions:
# contents: read # to read from project repo
# pages: write # to deploy to Pages
# id-token: write # to verify the deployment originates from an appropriate source

# # Deploy to the github-pages environment
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}

# runs-on: ubuntu-latest

# steps:
# - name: Checkout
# uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1

# - name: Setup Pages
# uses: actions/configure-pages@v3

# - name: Download JSDoc artifacts
# uses: actions/download-artifact@v3
# with:
# name: jsdoc
# path: ./docs

# - name: Upload artifact
# uses: actions/upload-pages-artifact@v1
# with:
# path: "./docs"

# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v2

0 comments on commit 1ad8018

Please sign in to comment.