Pre-process example notebooks #16
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: Pre-process example notebooks | |
on: | |
workflow_dispatch: | |
# TODO: Run when source repo releases are available on Conda Forge | |
# TODO: Run when the examples Conda environment is changed | |
jobs: | |
preprocess: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Conda environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: devtools/conda-envs/examples_env.yml | |
- name: Checkout deployment branch | |
uses: actions/checkout@v3 | |
with: | |
ref: _cookbook_data | |
path: 'deploy' | |
clean: false | |
- name: Prepare cache deployment directory | |
shell: bash -l {0} | |
run: | | |
cd deploy | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git rm -r . | |
- name: Pre-process and execute notebooks | |
shell: bash -l {0} | |
run: | | |
python source/_ext/proc_examples.py --prefix=deploy | |
- name: Deploy cache | |
shell: bash -l {0} | |
run: | | |
cd deploy | |
git add . | |
git commit -m "Deploy pre-processed notebook cache" | |
git push origin _cookbook_data |