-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (45 loc) · 1.78 KB
/
sphinx_docs.yml
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
46
47
48
49
50
51
52
53
54
55
name: sphinx docs
on:
push: # run on push to main and PR
branches:
- main
pull_request:
env:
DJANGO_ENV: docs
jobs:
docs:
name: sphinx documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
# uses .python-version to determine python version
# We base the python cache on the hash of all requirements files, so that
# if any change, the cache is invalidated.
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
pip-${{ hashFiles('requirements/*.txt') }}
pip-
- name: Install dependencies
run: pip install -r dev-requirements.txt
- name: Setup local_settings.py
run: python -c "import uuid; print('SECRET_KEY = \'%s\'' % uuid.uuid4())" >> ppa/settings/local_settings.py
- name: Build Sphinx docs
run: cd sphinx-docs && make -b coverage html
# for pull requests, exit with error if documentation coverage is incomplete
- name: Report on documentation coverage
if: ${{ github.event_name == 'pull_request' }}
run: if [[ $((`grep ppa _build/coverage/python.txt | grep -v 100 | wc -l`)) -eq 0 ]] ; then echo "Documentation coverage complete"; else cat sphinx-docs/_build/coverage/python.txt && exit 1; fi
# when building on push to main, publish the built docs
- name: Deploy built docs to github pages
if: ${{ github.event_name == 'push' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./sphinx-docs/_build/html