-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.37 KB
/
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
56
57
58
59
60
61
62
63
64
name: API Documentation
on:
push:
branches:
- main
paths:
- 'src/**'
- 'docs/**'
- '.github/workflows/docs.yml'
pull_request:
paths:
- 'src/**'
- 'docs/**'
- '.github/workflows/docs.yml'
jobs:
apidocs:
runs-on: ubuntu-latest
steps:
- name: Check out smax-python
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install numpy libs
run: pip install numpy
- name: Install psutil libs
run: pip install psutil
- name: Install redis libs
run: pip install redis
- name: Install Sphinx and RTM theme
run: pip install sphinx sphinx-rtd-theme
- name: Build docs
run: |
cd docs
sphinx-apidoc -o . ../src/smax
sphinx-build -M html . .
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: 'gh-pages'
path: site
- name: copy docs to gh-pages
run: cp -a docs/html/* site/
- name: Push to pages
run: |
cd site
git config --global user.email "$GITHUB_JOB+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions"
git add -A
git commit -m "[automated site update]" && git push || true