-
Notifications
You must be signed in to change notification settings - Fork 652
45 lines (43 loc) · 1.23 KB
/
documentation.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Docs
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Setup poetry virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Cache for the virtual environment based on pyproject.toml
with:
path: ./.venv
key: ${{ runner.os }}-venv-docs-${{ hashFiles('pyproject.toml') }}
- name: Install the project dependencies
run: poetry install --with docs -E all
- name: Sphinx build
run: |
cd docs
poetry run make html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master'}}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html/
force_orphan: true