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-03-11 02:03:56 +08:00
|
|
|
- '.github/**'
|
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
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
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
|