-
-
Notifications
You must be signed in to change notification settings - Fork 126
61 lines (52 loc) · 1.79 KB
/
publish-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
name: Build and publish documentation
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Set up Pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Bambi and all its dependencies
run: |
conda install -c conda-forge python-graphviz
conda install pip
pip install .
pip install .[dev]
pip install .[jax]
- name: Checkout gh-pages
uses: actions/checkout@v2
with:
ref: gh-pages
path: docs/_build/html
- name: Test build docs
if: github.ref != 'refs/heads/main' && ! startsWith(github.ref, 'refs/tags')
run: BUILDDIR=_build/html/main make -C docs/ local
- name: Build docs
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')
run: |
sphinx-build docs docs/_build/html
touch docs/_build/html/.nojekyll
- name: Publish docs to gh-pages
# Only once from main or a tag
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
keep_files: true