Skip to content

Commit 08ad141

Browse files
authored
Added gh pages aauto push
1 parent fd17244 commit 08ad141

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.github/workflows/build_docs.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,25 @@ jobs:
1414
- uses: ammaraskar/sphinx-action@master
1515
with:
1616
pre-build-command: "pip install -r dev.requirements.txt"
17-
docs-folder: "docs/"
17+
docs-folder: "docs/"
18+
# Publish built docs to gh-pages branch.
19+
# ===============================
20+
- name: Commit documentation changes
21+
run: |
22+
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
23+
cp -r docs/_build/html/* gh-pages/
24+
cd gh-pages
25+
touch .nojekyll
26+
git config --local user.email "[email protected]"
27+
git config --local user.name "GitHub Action"
28+
git add .
29+
git commit -m "Update documentation" -a || true
30+
# The above command will fail if no changes were present, so we ignore
31+
# that.
32+
- name: Push changes
33+
uses: ad-m/github-push-action@master
34+
with:
35+
branch: gh-pages
36+
directory: gh-pages
37+
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
# ===============================

0 commit comments

Comments
 (0)