forked from jameskabbes/HackIllinois2024
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.4 KB
/
documentation_build.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
name: gh-pages documentation builder
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx sphinx-rtd-theme
pip install -r code/requirements.txt
- name: Generate documentation
run: |
cd code/sphinx/
sphinx-apidoc -o . ../
make html
cd ../..
- name: Ensure docs directory exists
run: |
rm -rf docs
mkdir docs
- name: Move documentation files
run: |
mv code/sphinx/_build/html/* docs
- name: Add .nojekyll file
run: |
touch docs/.nojekyll
- uses: actions/checkout@master
with:
ref: gh-pages
path: gh-pages
- name: Commit and push changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add docs
git commit -m "Auto-generated documentation"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true