From 5b0083c0a8df2a5be4eb8eb593f220966d3e8637 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Wed, 30 Sep 2020 19:12:44 +0800 Subject: [PATCH] :construction_worker: add ci for dev branch --- .github/workflows/api_docs.yml | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/api_docs.yml diff --git a/.github/workflows/api_docs.yml b/.github/workflows/api_docs.yml new file mode 100644 index 00000000..63cf24f6 --- /dev/null +++ b/.github/workflows/api_docs.yml @@ -0,0 +1,41 @@ +name: Build API Doc + +on: + pull_request: + types: [opened, synchronize, reopened] + +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" + + - 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}}