-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (48 loc) · 1.6 KB
/
build_docs.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: docs_pages_workflow
# Execute this workflow automatically when a push is made to the trunk branch
on:
push:
branches: [ trunk ]
jobs:
build_docs_job:
runs-on: ubuntu-latest
environment: PRODUCTION
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install -r requirements.txt
python -m pip install -U sphinx==7.3.7
python -m pip install sphinx-book-theme==1.1.3
- name: Build the Sphinx docs
env:
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
TEST_CHAT_URL: ${{ secrets.TEST_CHAT_URL }}
run: |
# Navigate to the Sphinx documentation directory
cd docs || exit
# Remove old .rst files
rm source/*.rst
# But keep the index.rst file
git restore source/index.rst
# Build the docs .rst files
sphinx-apidoc -o source/ ../
# Build the Sphinx documentation
make html
- name: Verify the Sphinx docs build
run: |
if [ ! -f docs/build/html/index.html ]; then
echo "Documentation build failed"
exit 1
fi
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
force_orphan: true