Set up example notebooks as a gallery (#70) #9
This file contains hidden or 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: Deploy | |
| on: | |
| push: | |
| paths: | |
| - 'notebooks/**' | |
| - '.github/workflows/deploy.yaml' | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-20.04 | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - name: Git checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup python environment | |
| uses: ./.github/actions/setupconda | |
| - name: Print conda env | |
| run: | | |
| conda info | |
| conda list | |
| - name: Install Jupyterbook | |
| run: | | |
| mamba install -c conda-forge --yes jupyter-book | |
| - name: Build JupyterBook | |
| run: | | |
| jupyter-book build notebooks | |
| - name: Publish to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: notebooks/_build/html | |
| publish_branch: gh-pages | |
| - name: Save Build | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build | |
| path: notebooks/_build/ |