Build and deploy docs #1137
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
name: Build and deploy docs | |
on: | |
pull_request: | |
branches: | |
- main | |
- 'doc/**' | |
- 'docs/**' | |
tags: | |
- "*" | |
push: | |
branches: | |
- main | |
- 'doc/**' | |
- 'docs/**' | |
tags: | |
- "*" | |
schedule: | |
# run every Monday at 13 UTC, 5am PST, 8am eastern | |
- cron: '0 5 * * 1' | |
env: | |
CONDA: /local/tmp/kbmod-runner/miniconda3 | |
jobs: | |
build-docs: | |
name: Build docs | |
runs-on: self-hosted | |
defaults: | |
run: | |
shell: bash -leo pipefail {0} | |
steps: | |
- name: Setup environment | |
run: echo "/usr/local/cuda-12/bin" > $GITHUB_PATH | |
- name: Setup miniconda | |
uses: conda-incubator/[email protected] | |
with: | |
activate-environment: kbmod_docs_clone | |
- name: Switch environments | |
run: | | |
conda deactivate | |
conda create --name kbmod_docs_clone --clone kbmod_docs | |
conda activate kbmod_docs_clone | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Build KBMOD | |
run: | | |
python -m pip install .[docs] | |
- name: Build docs | |
run: | | |
sphinx-build -aEj 12 -b html docs/source docs/build/ | |
# internet seems scary with messages about and/or conditions not actually working | |
# for GH, so best to have a self-standing-step. | |
- name: Cron deploy docs | |
if: ${{ github.event_name == 'schedule' }} | |
run: | | |
cp -r docs/build/* /astro/store/epyc/users/kbmod/public_html/ | |
- name: Deploy docs | |
if: ${{ startsWith(github.event.head_commit.message, '[deploy_docs]') }} | |
run: | | |
cp -r docs/build/* /astro/store/epyc/users/kbmod/public_html/ | |
- name: Deploy alpha | |
if: ${{ startsWith(github.event.head_commit.message, '[deploy_alpha]') }} | |
run: | | |
cp -r docs/build/* /astro/store/epyc/users/kbmod/public_html/alpha |