-
Notifications
You must be signed in to change notification settings - Fork 28
48 lines (39 loc) · 1.22 KB
/
deploy_docs.yaml
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
45
46
47
48
name: Deploy GitHub Pages
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python environment
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup pandoc, required for nbsphinx
uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: "2.17.1"
- name: Try to load cached dependencies
uses: actions/cache@v3
id: restore-cache
with:
path: ${{ env.pythonLocation }}
key: python-docs-dependencies-${{ hashFiles('pyproject.toml') }}-${{ env.pythonLocation }}
- name: Install dependencies on cache miss
run: |
pip install --no-cache-dir --upgrade pip
pip install --no-cache-dir ".[docs]"
if: steps.restore-cache.outputs.cache-hit != 'true'
- name: Build Sphinx
run: python -m sphinx -Ea docs build
- name: Deploy Sphinx
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build