style: format #8
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
# yaml-language-server: $schema=https://json-schema.org/draft-07/schema# | |
name: Build Doc | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-doc: | |
name: Build documentation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python runtime | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.9 | |
- name: Install Python dependencies | |
run: | | |
pip install -r requirements.txt | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: latest | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
cache: pnpm | |
- name: Install Node dependencies | |
run: | | |
pnpm i | |
- name: Build | |
env: | |
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} | |
ENABLE_MATHJAX: false | |
run: | | |
pnpm build | |
- name: Deploy to gh-pages | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: site | |
force_orphan: true | |
user_name: "github-actions[bot]" | |
user_email: "github-actions[bot]@users.noreply.github.com" | |
commit_message: 🚀 Deploying to gh-pages @ ${{ env.GITHUB_SHA }} |