added build command for docs and created github action w/ burnettk

This commit is contained in:
jasquat 2023-06-26 11:33:27 -04:00
parent e9322b29c1
commit 6ba2d23e09
2 changed files with 69 additions and 0 deletions

42
.github/workflows/docs.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Docs
on:
- push
- pull_request
defaults:
run:
working-directory: docs
jobs:
build:
name: build-docs
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3.3.0
- name: Set up Python
uses: actions/setup-python@v4.6.1
with:
python-version: 3.11
- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Upgrade pip in virtual environments
shell: python
run: |
import os
import pip
with open(os.environ["GITHUB_ENV"], mode="a") as io:
print(f"VIRTUALENV_PIP={pip.__version__}", file=io)
- name: Pip Install
run: |
pip install -r requirements.txt
- name: Build
run: |
./bin/build --ci

27
docs/bin/build Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
function error_handler() {
>&2 echo "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}."
exit "$2"
}
trap 'error_handler ${LINENO} $?' ERR
set -o errtrace -o errexit -o nounset -o pipefail
run_ci="false"
if grep -qE -- "--ci\>" <<<"$@" ; then
run_ci="true"
fi
rm -rf _build/html
sphinx_command="sphinx-autobuild"
if [[ "$run_ci" == "true" ]]; then
sphinx_command="sphinx-build"
fi
#>> sphinx-build --help 2>&1 | grep -E '^ +\-[aWn]\>'
# -a write all files (default: only write new and changed
# -j N build in parallel with N processes where possible
# -n nit-picky mode, warn about all missing references
# -W turn warnings into errors
"$sphinx_command" . _build/html -W -a -n -j auto