Generate and Deploy Docs #14
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: docs | |
run-name: Generate and Deploy Docs | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
generate_docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: Install dependencies | |
run: | | |
npm install -g yarn | |
yarn install | |
- name: Generate documentation | |
run: yarn typedoc | |
- name: Commit and push to gh-pages | |
run: | | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
git fetch -a | |
git checkout gh-pages | |
git pull | |
git rm -rf . | |
mv docs/* . | |
git add . | |
git commit -m "Generate and deploy documentation" | |
git push | |
deploy_docs: | |
needs: generate_docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@4.1.5 | |
with: | |
branch: gh-pages | |
folder: . |