Skip to content

Commit e8e9be8

Browse files
authored
Merge pull request #290 from meekhumor/master
Add GitHub Action for Automated Sphinx Docs Update
2 parents a836578 + 2a541b8 commit e8e9be8

File tree

4 files changed

+51
-2
lines changed

4 files changed

+51
-2
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build and Update Sphinx Docs
2+
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
workflow_dispatch:
9+
10+
11+
jobs:
12+
build-docs:
13+
runs-on: ubuntu-latest
14+
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.10'
25+
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install "sphinx>=8.1.3" "sphinx-rtd-theme>=3.0.2"
31+
pip install -e .
32+
33+
34+
- name: Build Sphinx Docs
35+
run: |
36+
cd docs/py_docs
37+
rm -rf _build/html/* # Clean old files
38+
sphinx-build -b html . _build/html
39+
40+
41+
- name: Commit updated docs
42+
run: |
43+
git config --local user.email "[email protected]"
44+
git config --local user.name "GitHub Action"
45+
git add docs/py_docs/_build/html/*
46+
git commit -m "Update Sphinx documentation in docs/py_docs/_build/html" || echo "No changes to commit"
47+
git push
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docs/py_docs/_build/html/modules.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<script src="_static/documentation_options.js?v=51b770b3"></script>
1717
<script src="_static/doctools.js?v=9bcbadda"></script>
1818
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
19-
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
2019
<script src="_static/js/theme.js"></script>
2120
<link rel="index" title="Index" href="genindex.html" />
2221
<link rel="search" title="Search" href="search.html" />

docs/py_docs/_build/html/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/py_docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
extensions = [
1818
"sphinx.ext.autodoc",
19+
"sphinx.ext.mathjax",
1920
]
2021

2122
templates_path = ["_templates"]

0 commit comments

Comments
 (0)