Skip to content

Commit 9cbc8dc

Browse files
committed
ci: add workflow for deploying Sphinx documentation
1 parent 4c9f004 commit 9cbc8dc

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy Sphinx Documentation
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.10'
18+
19+
- name: Install dependencies
20+
run: |
21+
pip install -r requirements.txt
22+
pip install -r docs/requirements.txt
23+
24+
- name: Generate rst files
25+
run: sphinx-apidoc -o docs/source src/mastermind -f --templatedir=docs/source/_templates --maxdepth=2 --module-first
26+
27+
- name: Build documentation
28+
run: |
29+
cd docs
30+
make html
31+
32+
- name: Deploy to GitHub Pages
33+
if: success()
34+
uses: peaceiris/actions-gh-pages@v3
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
publish_dir: ./docs/build/html
38+
publish_branch: gh-pages
39+
keep_files: false # remove old files

0 commit comments

Comments
 (0)