Retry website build #300
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/attrs-opencv-constraints-1.3.4 | |
paths: | |
- "docs/**" | |
- "README.rst" | |
- ".github/workflows/website.yml" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Setup | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Cache conda | |
uses: actions/cache@v1 | |
env: | |
# Increase this value to reset cache if environment_build.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment_build.yml', 'requirements.txt') }} | |
- name: Setup Miniconda | |
# https://github.com/conda-incubator/setup-miniconda | |
uses: conda-incubator/[email protected] | |
with: | |
python-version: 3.7 | |
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | |
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 | |
shell: bash -l {0} | |
run: | | |
pip install lxml[html_clean] | |
cd docs | |
python make_api_doctree.py | |
make html | |
- name: Deploy (sleap.ai) | |
uses: peaceiris/actions-gh-pages@v3 | |
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@v3 | |
if: github.ref != 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: docs/build/html | |
destination_dir: develop |