-
Notifications
You must be signed in to change notification settings - Fork 10
66 lines (52 loc) · 1.57 KB
/
doc.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
56
57
58
59
60
61
62
63
64
65
66
name: "Sphinx: Render docs"
on:
push:
branches:
- 'master'
pull_request:
env:
GIT_USER_NAME: BattINFO Developers
GIT_USER_EMAIL: "[email protected]"
jobs:
updatepages:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
# System dependencies
sudo apt-get update && sudo apt-get install -y pandoc
# Python dependencies
python -m pip install --upgrade pip
pip install -U setuptools wheel
pip install -r requirements_docs.txt -r sphinx/requirements.txt
- name: Render documentation from ttl
run: python sphinx/ttl_to_rst.py
- name: Build HTML
run: make html
working-directory: sphinx
env:
# -v: Verbose
# -W: Turn warnings into errors
SPHINXOPTS: "-v -W"
# Still upload built documentation as an artifact if not deploying
# This is to provide the opportunity to download the built documentation
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: documentationHTML
path: sphinx/_build/html/
# Only deploy if pushing to 'master'
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: sphinx/_build/html