2023-02-22 23:06:52 +08:00
|
|
|
name: Build and Deploy Docs
|
2023-02-09 18:02:57 +08:00
|
|
|
|
2023-02-09 23:11:18 +08:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2023-02-09 18:02:57 +08:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'develop'
|
|
|
|
paths:
|
2023-03-07 06:32:16 +08:00
|
|
|
- 'docs/**'
|
2023-02-09 18:02:57 +08:00
|
|
|
|
2023-02-22 23:06:52 +08:00
|
|
|
# Do not build the docs concurrently
|
2023-02-09 18:02:57 +08:00
|
|
|
concurrency:
|
|
|
|
group: docs
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
2023-02-22 23:06:52 +08:00
|
|
|
build:
|
|
|
|
name: Build docs
|
2023-02-09 18:02:57 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: ./docs
|
|
|
|
steps:
|
|
|
|
# Setup
|
2024-03-11 23:28:35 +08:00
|
|
|
- uses: actions/checkout@v4
|
2024-03-23 21:44:38 +08:00
|
|
|
- uses: actions/setup-node@v4
|
2023-02-09 18:02:57 +08:00
|
|
|
with:
|
2023-12-07 04:09:30 +08:00
|
|
|
node-version: 20
|
|
|
|
cache: npm
|
|
|
|
cache-dependency-path: ./docs/package-lock.json
|
2023-02-09 18:02:57 +08:00
|
|
|
- name: Install dependencies
|
2023-12-07 04:09:30 +08:00
|
|
|
run: npm ci
|
2023-02-09 18:02:57 +08:00
|
|
|
|
|
|
|
# Build static docs
|
|
|
|
- name: Build all versions
|
|
|
|
run: ./build.sh
|
|
|
|
- name: Build website
|
2023-12-07 04:09:30 +08:00
|
|
|
run: npm run docusaurus build
|
2023-02-22 23:06:52 +08:00
|
|
|
- name: upload build artifact
|
|
|
|
uses: actions/upload-pages-artifact@v1
|
2023-02-09 18:02:57 +08:00
|
|
|
with:
|
2023-02-22 23:06:52 +08:00
|
|
|
path: ./docs/build
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
name: Deploy docs to gh-pages
|
|
|
|
needs: build
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
environment:
|
|
|
|
name: Documentation
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: deploy to GitHub Pages
|
|
|
|
id: deployment
|
|
|
|
uses: actions/deploy-pages@v1
|