2020-09-30 19:12:44 +08:00
|
|
|
name: Build API Doc
|
|
|
|
|
|
|
|
on:
|
2020-11-26 20:18:36 +08:00
|
|
|
pull_request:
|
2021-02-06 10:54:50 +08:00
|
|
|
types: [opened, synchronize, reopened]
|
2020-09-30 19:12:44 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.8
|
|
|
|
architecture: "x64"
|
|
|
|
|
2021-01-18 14:43:06 +08:00
|
|
|
- uses: Gr1N/setup-poetry@v4
|
|
|
|
|
|
|
|
- uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pypoetry/virtualenvs
|
2021-11-22 23:31:03 +08:00
|
|
|
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
|
2021-01-18 14:43:06 +08:00
|
|
|
|
|
|
|
- name: Set up dependencies
|
2020-09-30 19:12:44 +08:00
|
|
|
run: |
|
2021-02-06 10:54:50 +08:00
|
|
|
poetry install -E all
|
2020-09-30 19:12:44 +08:00
|
|
|
|
|
|
|
- name: Build Doc
|
|
|
|
run: poetry run sphinx-build -M markdown ./docs_build ./build
|
|
|
|
|
|
|
|
- name: Copy Files
|
|
|
|
run: cp -r ./build/markdown/* ./docs/api/
|
|
|
|
|
2020-11-26 20:18:36 +08:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: docs
|
|
|
|
path: docs/
|