Skip to content

Commit 40a2e80

Browse files
authored
Merge pull request #72 from MunchLab/auto-deploy-docs
make docs deploy from gh-pages branch
2 parents 9a69aa1 + 79d94ff commit 40a2e80

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

.github/workflows/deploy_docs.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
deploy-docs:
13+
name: Build and deploy documentation to gh-pages
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.9"
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install .
27+
pip install sphinx sphinx-rtd-theme myst-parser nbsphinx matplotlib
28+
29+
- name: Build documentation
30+
run: |
31+
rm -rf docs
32+
mkdir -p docs
33+
sphinx-build -M html doc_source docs
34+
rsync -a docs/html/ docs/
35+
rm -rf docs/html
36+
touch docs/.nojekyll
37+
38+
- name: Deploy to GitHub Pages
39+
uses: peaceiris/actions-gh-pages@v3
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
publish_dir: ./docs
43+
publish_branch: gh-pages
44+
force_orphan: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ instance/
7272
.scrapy
7373

7474
# Sphinx documentation
75+
docs/
7576
docs/_build/
7677

7778
# PyBuilder

doc_source/.nojekyll

Whitespace-only changes.

0 commit comments

Comments
 (0)