This repository has been archived by the owner on Oct 27, 2023. It is now read-only.
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: Build Jupyter Notebooks | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
PYTHON_VER: '3.11' | |
PYDEVD_DISABLE_FILE_VALIDATION: 1 | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Setup Python ${{ env.PYTHON_VER }} | |
uses: actions/setup-python@v4 | |
id: python | |
with: | |
python-version: ${{ env.PYTHON_VER }} | |
- uses: syphar/restore-virtualenv@v1 | |
id: cache-virtualenv | |
with: | |
requirement_files: requirements.txt # this is optional | |
- uses: syphar/restore-pip-download-cache@v1 | |
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | |
# the package installation will only be executed when the | |
# requirements-files have changed. | |
- name: Install Python dependencies | |
run: pip install -r requirements.txt | |
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | |
- name: Build website | |
run: jupyter-book build docs/ --keep-going | |
- name: Upload page artifact | |
if: ${{ github.ref == 'refs/heads/main' }} | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: docs/_build/html | |
# Deployment job | |
deploy: | |
needs: ci | |
if: ${{ github.ref == 'refs/heads/main' }} | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |