User docs / jupyterbook #31
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: User docs / jupyterbook | |
# We should trigger this from an upload event | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
workflow_run: | |
workflows: ["Conda Deployment"] | |
branches: [master] | |
types: | |
- completed | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache conda | |
uses: actions/cache@v1 | |
env: | |
# Increase this value to reset cache if etc/example-environment.yml has not changed | |
CACHE_NUMBER: 1 | |
with: | |
path: | | |
~/conda_pkgs_dir | |
~/.cache/pip | |
/usr/share/miniconda3/envs/jupyter-book | |
~/quagmire/jupyterbook/_build | |
key: ubu-jbdoc-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/workflows/resources/conda_jb_docs_environment.yml') }} | |
- name: Miniconda + Cache | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" | |
auto-update-conda: true | |
environment-file: .github/workflows/resources/conda_jb_docs_environment.yml | |
activate-environment: conda-build-docs | |
python-version: 3.7 | |
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | |
- name: Install quagmire | |
shell: bash -l {0} | |
run: | | |
VERSION=`python setup.py --version` | |
# install latest quagmire via conda, then over-ride with this source code | |
pip install -e . | |
- name: Build docs with jupyterbook | |
shell: bash -l {0} | |
run: | | |
VERSION=`python setup.py --version` | |
echo "VERSION=$(echo $VERSION)" >> $GITHUB_ENV | |
cd jupyterbook | |
jupyter-book build . | |
# Note deploy key needs the ----BEGIN ... KEY---- lines too | |
## Always deploy to version directory | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.GH_PAGES_DEPLOY_PR_KEY }} | |
destination_dir: ${{ env.VERSION }} | |
publish_dir: jupyterbook/_build/html | |