Deploy Book #789
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 Book | |
| on: | |
| workflow_run: | |
| workflows: ["Update Metadata"] | |
| types: | |
| - completed | |
| branches: | |
| - main | |
| jobs: | |
| deploy-book: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Python | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: '.python-version' | |
| cache: pip | |
| - name: Install Python dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| # R | |
| - name: Set up R | |
| uses: r-lib/actions/setup-r@v2 | |
| - name: Install R dependencies | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| cache: true | |
| cache-version: 1 | |
| packages: | | |
| any::tidyverse | |
| any::IRkernel | |
| # Jupyter Kernels | |
| - name: Print kernelspec version | |
| run: | | |
| jupyter kernelspec --version | |
| - name: Print all kernels | |
| run: | | |
| jupyter kernelspec list | |
| - name: Set up IRkernel | |
| run: | | |
| IRkernel::installspec(name="ir", displayname="R") | |
| shell: Rscript {0} | |
| - name: Print all kernels again | |
| run: | | |
| jupyter kernelspec list | |
| # (optional) Cache your executed notebooks between runs | |
| # if you have config: | |
| # execute: | |
| # execute_notebooks: cache | |
| - name: cache executed notebooks | |
| uses: actions/cache@v4 | |
| with: | |
| path: _build/.jupyter_cache | |
| key: jupyter-book-cache-${{ hashFiles('requirements.txt') }} | |
| - name: Build the book | |
| run: | | |
| jupyter-book build . | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: "_build/html" | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |