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
|
|
|
|
- uses: actions/setup-node@v4
|
2023-02-09 18:02:57 +08:00
|
|
|
with:
|
|
|
|
node-version: 18
|
|
|
|
cache: yarn
|
|
|
|
cache-dependency-path: ./docs/yarn.lock
|
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install --frozen-lockfile
|
|
|
|
|
|
|
|
# Build static docs
|
|
|
|
- name: Build all versions
|
|
|
|
run: ./build.sh
|
|
|
|
- name: Build website
|
|
|
|
run: yarn 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
|