Skip to content

Commit 5b1af90

Browse files
committed
Add GH pages workflow
1 parent b8e52c2 commit 5b1af90

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/gh-pages.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: GitHub Pages sphinx deployment
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- now-with-gh-pages
8+
workflow_dispatch:
9+
10+
jobs:
11+
# Ref: https://stackoverflow.com/questions/57989790/using-github-actions-to-publish-documentation
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.9'
21+
22+
- name: Upgrade pip
23+
run: |
24+
# pip >= 20.1 so we can use ``pip cache dir``
25+
python3 -m pip install --upgrade pip
26+
- name: Get pip cache dir
27+
id: pip-cache
28+
run: echo "::set-output name=dir::$(pip cache dir)"
29+
30+
- name: Cache dependencies
31+
uses: actions/cache@v3
32+
with:
33+
path: ${{ steps.pip-cache.outputs.dir }}
34+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
35+
restore-keys: |
36+
${{ runner.os }}-pip-
37+
- name: Install dependencies
38+
run: python3 -m pip install -U -r ./requirements.txt
39+
40+
- name: Build documentation
41+
run: make html
42+
43+
- name: Deploy
44+
uses: peaceiris/actions-gh-pages@v3
45+
with:
46+
github_token: ${{ secrets.GITHUB_TOKEN }}
47+
publish_dir: ./_build/html/
48+
publish_branch: gh-pages-2

0 commit comments

Comments
 (0)