2020-09-13 22:32:55 +08:00
|
|
|
name: Build API Doc
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [ opened, synchronize, reopened ]
|
|
|
|
branches: [ master, dev ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2020-09-23 23:32:34 +08:00
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.8
|
|
|
|
architecture: "x64"
|
2020-09-13 22:32:55 +08:00
|
|
|
|
|
|
|
- name: Install Dependences
|
2020-09-23 23:14:03 +08:00
|
|
|
run: |
|
2020-09-23 23:32:34 +08:00
|
|
|
python -m pip install --upgrade pip
|
2020-09-23 23:36:06 +08:00
|
|
|
pip install poetry
|
|
|
|
poetry install
|
2020-09-13 22:32:55 +08:00
|
|
|
|
|
|
|
- name: Build Doc
|
2020-09-23 23:42:06 +08:00
|
|
|
run: poetry run sphinx-build -M markdown ./docs_build ./build
|
2020-09-13 22:32:55 +08:00
|
|
|
|
|
|
|
- name: Copy Files
|
|
|
|
run: cp ./build/markdown/*.md ./docs/api/
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
git config user.name nonebot
|
|
|
|
git config user.email nonebot@nonebot.dev
|
|
|
|
git add .
|
2020-09-24 00:04:43 +08:00
|
|
|
git diff-index --quiet HEAD || git commit -m ":memo: update api docs"
|
2020-09-13 22:32:55 +08:00
|
|
|
git push
|