Update programming.md #155
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
# This script deploys the Jupyter Book to the GitHub Pages website | |
name: deploy | |
on: | |
push: | |
branches: | |
- publish | |
paths: | |
- "book/**" | |
- ".github/workflows/**" | |
- "requirements.txt" | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build-book: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
ref: publish | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: "3.10" | |
- name: Setup virtual environment | |
uses: syphar/restore-virtualenv@v1 | |
with: | |
requirement_files: requirements.txt | |
- name: Setup pip cache | |
uses: syphar/restore-pip-download-cache@v1 | |
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | |
- name: Build book | |
run: jupyter book build book/ | |
- name: Deploy book | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: book/_build/html/ |