Computational pattern tutorial edits #531
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: CI | |
on: | |
push: | |
branches: main | |
pull_request: | |
branches: main | |
# Required to publish to gh-pages branch | |
permissions: | |
contents: write | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup JupyterBook Cache | |
uses: actions/cache@v3 | |
with: | |
path: _build | |
# NOTE: change key to "jupyterbook-DATE" to force rebuilding cache | |
key: jupyterbook-20230112 | |
- uses: ./.github/actions/setupconda | |
- name: Build JupyterBook | |
# NOTE: login shell activates conda environment | |
shell: bash -l {0} | |
run: | | |
jupyter-book build ./ --warningiserror --keep-going | |
- name: Dump Build Logs | |
if: always() | |
run: | | |
if (test -a _build/html/reports/*log); then cat _build/html/reports/*log ; fi | |
- name: Publish to GitHub Pages | |
if: github.ref == 'refs/heads/main' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: _build/html | |
publish_branch: gh-pages | |
cname: tutorial.xarray.dev | |
enable_jekyll: false | |
- name: Save Build | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: _build/ |