Skip to content

Commit e75465d

Browse files
authored
Merge pull request #348 from jchanvfx/sphinx_docs_workflow
auto doc build action #347
2 parents dbf6aab + bbb1897 commit e75465d

File tree

4 files changed

+64
-5
lines changed

4 files changed

+64
-5
lines changed

.github/workflows/pypi_publish.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Workflow for publishing module package to https://pypi.org.
2-
name: PyPI Package Publish
2+
name: Publish PyPI Package
33

44
on:
55
# trigger this workflow when a release is published.
66
release:
7-
types: [published]
7+
types:
8+
- published
89

910
jobs:
1011
publish:
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Workflow for building the sphinx api documentation.
2+
name: Build API Documentation
3+
4+
on:
5+
# trigger this workflow when a release is published.
6+
release:
7+
types:
8+
- published
9+
10+
env:
11+
# environment variables.
12+
SOURCE_BRANCH: main
13+
GH_PAGES_BRANCH: gh-pages
14+
15+
jobs:
16+
build-docs:
17+
runs-on: ubuntu-latest
18+
steps:
19+
# Checks-out your repository under $GITHUB_WORKSPACE , so your workflow can access it.
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
# Install Graphviz required for the sphinx plugin.
25+
- name: Set up Graphviz
26+
uses: ts-graphviz/setup-graphviz@v1
27+
# Install a version of python.
28+
- name: Set up Python
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: 3.9
32+
# Install the python dependencies required for building.
33+
- name: Install Dependencies
34+
run: |
35+
pip install -U sphinx
36+
pip install sphinx-rtd-theme
37+
pip install PySide2
38+
pip install Qt.py
39+
# Set the local git configs.
40+
- name: Set Git Config
41+
run: |
42+
git config --local user.email "[email protected]"
43+
git config --local user.name "Github Actions"
44+
# Merge the "main" branch to the "gh-pages" branch.
45+
- name: Update "gh-pages" branch
46+
run: |
47+
git checkout $GH_PAGES_BRANCH
48+
git merge $SOURCE_BRANCH
49+
git push origin $GH_PAGES_BRANCH
50+
# Build the sphinx api documentation.
51+
- name: Run Sphinx Build
52+
run: sphinx-build -b html ./docs ./api -a -E
53+
# Deploy the html updates to the "gh-pages" branch.
54+
- name: Deploy HTML
55+
run: |
56+
git ls-files --others --exclude-standard
57+
git add ./api
58+
git commit -m "auto build docs"
59+
git push origin $GH_PAGES_BRANCH

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ venv/*
44

55
# sphinx documentation
66
docs/_build/
7-
api/*
87

98
# python stuff
109
*.pyc

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
'sphinx.ext.autosectionlabel',
4848
'sphinx.ext.autosummary',
4949
'sphinx.ext.coverage',
50+
'sphinx.ext.graphviz',
5051
'sphinx.ext.inheritance_diagram',
5152
'sphinx.ext.intersphinx',
5253
'sphinx.ext.napoleon',
53-
'autodocsumm',
5454
]
5555

5656
intersphinx_mapping = {
@@ -105,7 +105,7 @@
105105
#
106106
# This is also used if you do content translation via gettext catalogs.
107107
# Usually you set "language" from the command line for these cases.
108-
language = None
108+
language = 'en'
109109

110110
# List of patterns, relative to source directory, that match files and
111111
# directories to ignore when looking for source files.

0 commit comments

Comments
 (0)