Refactor auto-generate aeon_acquisition
docs
#94
Workflow file for this run
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: Docs | |
# Generate the documentation on all merges to main, all pull requests, or by | |
# manual workflow dispatch. The build job can be used as a CI check that the | |
# docs still build successfully. The deploy job only runs (1) when a tag is | |
# pushed or (2) on manual workflow dispatch. This will move the generated html | |
# to the gh-pages branch (which triggers a GitHub pages deployment). | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build_sphinx_docs: | |
name: Build Sphinx Docs | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: false # Disable automatic checkout of all submodules | |
- name: Fetch tags | |
run: | | |
git fetch --prune --prune-tags --force --depth=1 --no-recurse-submodules | |
- name: Checkout public submodules # Skip aeon_experiments | |
run: | | |
git submodule sync | |
git submodule update --init aeon_acquisition | |
git submodule update --init aeon_analysis | |
git submodule update --init aeon_mecha | |
- name: Set up conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channels: conda-forge, nodefaults | |
activate-environment: aeon_docs | |
environment-file: environment.yml | |
- name: Check external links | |
run: make linkcheck | |
# needs to have sphinx.ext.githubpages in conf.py extensions list | |
- name: Building documentation | |
run: make html | |
- name: Upload the content for deployment | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: ./docs/ | |
deploy_sphinx_docs: | |
name: Deploy Sphinx Docs | |
needs: build_sphinx_docs | |
permissions: | |
contents: write | |
if: (github.event_name == 'push' && github.ref_type == 'tag') || github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Clear previous build if present | |
shell: bash | |
run: rm -rf ./docs/ | |
- name: Download the content for deployment | |
uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
path: ./docs/ | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/html/ |