-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0e59cd
commit 432b793
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "book/**" | ||
- ".github/workflows/**" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build-book: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.12" | ||
|
||
# Setup virtualenv with caching | ||
- name: Setup venv | ||
uses: syphar/restore-virtualenv@v1 | ||
with: | ||
requirement_files: requirements.txt | ||
|
||
# Pip download cache | ||
- name: Setup pip cache | ||
uses: syphar/restore-pip-download-cache@v1 | ||
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | ||
|
||
# Install dependencies | ||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
pip install -r requirements.txt | ||
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | ||
|
||
# Build the Jupyter Book | ||
- name: Build book | ||
run: | | ||
jupyter book build book/ | ||
- name: GitHub Pages actions | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: book/_build/html/ | ||
nojekyll: true |