Skip to content

Commit 3426e9f

Browse files
committed
ci: Update GitHub action for documentation deployment
1 parent 06c3e22 commit 3426e9f

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

.github/workflows/docs_pages.yaml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,22 @@ jobs:
1212
uses: actions/checkout@master
1313
with:
1414
fetch-depth: 0
15-
- name: Build and Commit
16-
uses: sphinx-notes/pages@master
15+
- name: Sphinx build
16+
uses: ammaraskar/sphinx-action@master
1717
with:
18-
documentation_path: docs
19-
extra_files: .nojekyll
18+
docs-folder: docs/
19+
- name: Commit documentation changes
20+
run: |
21+
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
22+
cp -r docs/_build/html/* gh-pages/
23+
cd gh-pages
24+
git config --local user.email "action@github.com"
25+
git config --local user.name "GitHub Action"
26+
git add .
27+
git commit -m "Update documentation" -a || true
2028
- name: Push changes
2129
uses: ad-m/github-push-action@master
2230
with:
23-
github_token: ${{ secrets.GITHUB_TOKEN }}
2431
branch: gh-pages
32+
directory: gh-pages
33+
github_token: ${{ secrets.GITHUB_TOKEN }}

.nojekyll

Whitespace-only changes.

docs/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@
3131
# Add any Sphinx extension module names here, as strings. They can be
3232
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3333
# ones.
34-
extensions = ["sphinx_rtd_theme", "sphinx.ext.autodoc", "sphinx.ext.napoleon"]
34+
extensions = [
35+
"sphinx_rtd_theme",
36+
"sphinx.ext.autodoc",
37+
"sphinx.ext.napoleon",
38+
"sphinx.ext.githubpages",
39+
]
3540

3641
# Add any paths that contain templates here, relative to this directory.
3742
templates_path = ["_templates"]

0 commit comments

Comments
 (0)