-
Notifications
You must be signed in to change notification settings - Fork 13
44 lines (37 loc) · 1.12 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: docs
on:
push:
branches:
- main
pull_request:
jobs:
docs:
name: docs
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cache/pip-docs
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -e '.[docs]'
# build docs in strict mode as a check for pull requests
- name: Build docs (strict mode)
if: ${{ github.event_name == 'pull_request' }}
run: mkdocs build -v --strict
# build docs for publication
- name: Build docs
if: ${{ github.event_name == 'push' }}
run: mkdocs build
# when building on push to main, publish the compiled documentation
- name: Deploy built docs to github pages
if: ${{ github.event_name == 'push' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site