-
Notifications
You must be signed in to change notification settings - Fork 5
70 lines (59 loc) · 1.74 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Build and deploy sphinx documentation to GitHub Pages
name: docs
on:
push:
branches:
- main
paths:
- "src/**"
- "docs/**"
- "pyproject.toml"
- "poetry.lock"
- "poetry.toml"
- "!**.md"
- "!.github/workflows/ci.yml"
pull_request:
paths-ignore:
- "**.md"
workflow_dispatch:
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: "release"
- name: Install spatstat subpackages and extensions
run:
Rscript -e 'install.packages(c("spatstat.explore", "spatstat.geom"))'
- name: Install Poetry
uses: snok/install-poetry@v1
# with:
# virtualenvs-create: true
# virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install package with main (non-optional) and docs dependencies
# see [tool.poetry.dependencies] and [tool.poetry.extras]
# in pyproject.toml
run: poetry install -E docs
- name: Build docs with sphinx
run: poetry run sphinx-build -b html docs docs/_build/html
- name: Deploy documentation to gh-pages branch
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: gh-pages
FOLDER: docs/_build/html
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}