refactor sphinx doc workflow #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Sphinx documentation to Pages | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
paths: | |
- 'docs/**/*' | |
push: | |
branches: | |
- main | |
- 'feature/**' | |
jobs: | |
pages: | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: '3.9' | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@master | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@master | |
with: | |
python_version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: | | |
pip install -q -e .[full] | |
- id: build | |
name: Build Documentation | |
run: | | |
cd docs/sphinx_doc | |
make clean html | |
- name: Upload Documentation | |
uses: actions/upload-artifact@v3 | |
with: | |
name: SphinxDoc | |
path: 'docs/sphinx_doc/build' | |
- uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.event_name == 'push' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: 'docs/sphinx_doc/build' |