Skip to content

Commit 24c7996

Browse files
Create docs.yml
1 parent 5f8f2a4 commit 24c7996

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/docs.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Pull Request Docs Check"
2+
on:
3+
- pull_request
4+
5+
jobs:
6+
docs:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- uses: ammaraskar/sphinx-action@master
11+
with:
12+
docs-folder: "docs/"
13+
14+
- uses: actions/upload-artifact@v1
15+
with:
16+
name: DocumentationHTML
17+
path: docs/_build/html/
18+
19+
- name: Commit documentation changes
20+
run: |
21+
git clone https://github.com/your_git/repository.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 "[email protected]"
25+
git config --local user.name "GitHub Action"
26+
git add .
27+
git commit -m "Update documentation" -a || true
28+
# The above command will fail if no changes were present, so we ignore
29+
# the return code.
30+
- name: Push changes
31+
uses: ad-m/github-push-action@master
32+
with:
33+
branch: gh-pages
34+
directory: gh-pages
35+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)