Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: versioned TypeDoc #203

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 65 additions & 31 deletions .github/workflows/typedoc.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,84 @@
name: Publish TypeDoc
on:
push:
branches:
- master
workflow_dispatch:
workflow_call:
permissions:
contents: write # allows the 'Commit' step without tokens

jobs:
build-docs:
get_history: # create an artifact from the existing documentation builds
runs-on: ubuntu-latest
steps:
- name: Checkout repository
steps:
- name: get the typedoc repo
uses: actions/checkout@v4
with:
persist-credentials: false
ref: typedoc

- name: Setup node
uses: actions/setup-node@v4
- name: tar the existing docs
run: |
mkdir -p ./docs
tar -cvf documentation.tar ./docs

- name: create a document artifact
uses: actions/upload-artifact@v4
with:
node-version: latest
cache: npm
cache-dependency-path: package-lock.json
name: documentation
path: documentation.tar

- name: Install deps
run: npm i
build: # builds the distribution and then the documentation
needs: get_history
runs-on: ubuntu-latest
steps:
- name: Checkout src
uses: actions/checkout@v4

- name: Build docs
run: npm run build:docs
- run: mkdir -p ./docs
- name: Download the existing documents artifact
uses: actions/download-artifact@v4
with:
name: documentation
- run: tar -xf documentation.tar ./docs -C ./docs

- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
- name: Build
uses: actions/setup-node@v4
with:
path: docs/
node-version: lts/*
cache: npm
- run: npm i
- run: npm run build # set up 'build' script in your package.json

deploy-docs:
needs: build-docs
- name: Build documents
run: npm run build:docs #set up 'build:docs' build script in your package.json

permissions:
id-token: write
pages: write
- name: tar the new docs
run: tar -cvf newdocumentation.tar ./docs

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
- name: create a new document artifact
uses: actions/upload-artifact@v4
with:
name: newdocumentation
path: newdocumentation.tar

commit: # commit the old and new merged documents to typedoc/docs
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

- name: checkout the typedoc repo
uses: actions/checkout@v4
with:
ref: typedoc

- run: mkdir -p ./docs
- name: Download the new documents artifact
uses: actions/download-artifact@v4
with:
name: newdocumentation
- run: tar -xf newdocumentation.tar ./docs -C ./docs

- name: commit
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add .
git commit -m "Updated the docs"
git push
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
.DS_Store
node_modules/
dist/
docs/
package-lock.json
pnpm-lock.yaml
yarn.lock
yarn-debug.log*
Expand Down
145 changes: 108 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading