Skip to content

Commit d225698

Browse files
committed
2 parents 6365f3c + a1ff94c commit d225698

File tree

2 files changed

+54
-51
lines changed

2 files changed

+54
-51
lines changed

.github/workflows/github_pages.yml

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,65 @@
11
name: deploy-book
22

3-
# Run this when the master or main branch changes
43
on:
54
push:
65
branches:
7-
- master
8-
- main
9-
# If your git repository has the Jupyter Book within some-subfolder next to
10-
# unrelated files, you can make this run only if a file within that specific
11-
# folder has been modified.
12-
#
13-
# paths:
14-
# - some-subfolder/**
15-
16-
# This job installs dependencies, builds the book, and pushes it to `gh-pages`
6+
- master
7+
- main
8+
179
jobs:
1810
deploy-book:
1911
runs-on: ubuntu-latest
2012
permissions:
2113
pages: write
2214
id-token: write
2315
steps:
24-
- uses: actions/checkout@v4
25-
26-
# Install dependencies
27-
- name: Set up Python 3.11
28-
uses: actions/setup-python@v5
29-
with:
30-
python-version: '3.11'
31-
cache: pip # Implicitly uses requirements.txt for cache key
32-
33-
- name: Install dependencies
34-
run: pip install -r requirements.txt
35-
36-
# (optional) Cache your executed notebooks between runs
37-
# if you have config:
38-
# execute:
39-
# execute_notebooks: cache
40-
- name: cache executed notebooks
41-
uses: actions/cache@v4
42-
with:
43-
path: _build/.jupyter_cache
44-
key: jupyter-book-cache-${{ hashFiles('requirements.txt') }}
45-
46-
# Build the book
47-
- name: Build the book
48-
run: |
49-
jupyter-book build .
50-
51-
# Upload the book's HTML as an artifact
52-
- name: Upload artifact
53-
uses: actions/upload-pages-artifact@v3
54-
with:
55-
path: "_build/html"
56-
57-
# Deploy the book's HTML to GitHub Pages
58-
- name: Deploy to GitHub Pages
59-
id: deployment
60-
uses: actions/deploy-pages@v4
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python 3.11
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.11'
22+
cache: pip
23+
24+
- name: Install dependencies (requirements.txt)
25+
run: |
26+
python -m pip install --upgrade pip
27+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
28+
# ensure jupyter-book is installed even if not in requirements.txt
29+
pip install -U jupyter-book
30+
31+
- name: Show repo root (debug)
32+
run: |
33+
echo "PWD: $(pwd)"
34+
ls -la
35+
36+
- name: cache executed notebooks
37+
uses: actions/cache@v4
38+
with:
39+
path: _build/.jupyter_cache
40+
key: jupyter-book-cache-${{ hashFiles('requirements.txt') }}
41+
42+
- name: Build the book
43+
run: |
44+
set -euxo pipefail
45+
# build the book; adjust command if your sources sit in a subfolder
46+
jupyter-book build .
47+
48+
- name: Show _build contents (debug)
49+
run: |
50+
echo "----- ls -la _build -----"
51+
ls -la _build || true
52+
echo "----- recursive find for html dirs under _build -----"
53+
find _build -maxdepth 5 -type d -name 'html' -print || true
54+
echo "----- all files under _build -----"
55+
find _build -maxdepth 5 -print || true
56+
57+
- name: Upload artifact (pages)
58+
uses: actions/upload-pages-artifact@v3
59+
with:
60+
# keep _build/html as default, but if your build wrote elsewhere (see above debug)
61+
path: _build/html
62+
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

_toc.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
format: jb-book
22
root: index
33
chapters:
4-
- file: Project_1
5-
- file: 0928_webpage_summarizer
6-
- file: 1025_brochure_generator
4+
- file: Project_1

0 commit comments

Comments
 (0)