-
Notifications
You must be signed in to change notification settings - Fork 97
66 lines (59 loc) · 1.82 KB
/
website.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
# Builds static content for GitHub pages.
name: Build website
on:
push:
branches:
# 'main' triggers updates to 'sleap.ai', all others to 'sleap.ai/develop'
- main
- develop
- liezl/update-intallation-docs-1.4.1
paths:
- "docs/**"
- "README.rst"
- ".github/workflows/website.yml"
jobs:
build:
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout
uses: actions/checkout@v4
- name: Setup Miniconda
# https://github.com/conda-incubator/setup-miniconda
uses: conda-incubator/setup-miniconda@v3.0.3
with:
python-version: 3.7
environment-file: environment_no_cuda.yml
activate-environment: sleap_ci
- name: Print environment info
shell: bash -l {0}
run: |
which python
conda info
- name: Build
# """Could not import extension myst_nb (exception: lxml.html.clean module is now
# a separate project lxml_html_clean. Install lxml[html_clean] or
# lxml_html_clean directly.)"""
shell: bash -l {0}
run: |
pip install lxml[html_clean]
pip install sphinx-tabs
cd docs
python make_api_doctree.py
make html
- name: Deploy (sleap.ai)
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: docs/build/html
keep_files: true
- name: Deploy (test)
uses: peaceiris/actions-gh-pages@v4
if: github.ref != 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: docs/build/html
destination_dir: develop