2020-09-30 19:12:44 +08:00
|
|
|
name: Build API Doc
|
|
|
|
|
|
|
|
on:
|
2020-10-28 13:42:20 +08:00
|
|
|
pull_request_target:
|
2020-09-13 22:32:55 +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 }}
|
2020-10-28 13:05:51 +08:00
|
|
|
token: ${{ secrets.GH_TOKEN }}
|
2020-09-30 19:12:44 +08:00
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.8
|
|
|
|
architecture: "x64"
|
|
|
|
|
|
|
|
- name: Install Dependences
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install poetry
|
|
|
|
poetry install
|
|
|
|
|
|
|
|
- name: Build Doc
|
|
|
|
run: poetry run sphinx-build -M markdown ./docs_build ./build
|
|
|
|
|
|
|
|
- name: Copy Files
|
|
|
|
run: cp -r ./build/markdown/* ./docs/api/
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
git config user.name nonebot
|
|
|
|
git config user.email nonebot@nonebot.dev
|
|
|
|
git add .
|
|
|
|
git diff-index --quiet HEAD || git commit -m ":memo: update api docs"
|
|
|
|
git remote -vv
|
|
|
|
git remote add target ${{github.event.pull_request.head.repo.clone_url}}
|
|
|
|
git push target HEAD:${{github.event.pull_request.head.ref}}
|