-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (77 loc) · 2.35 KB
/
deploy.yml
File metadata and controls
89 lines (77 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: deploy
on:
# Trigger the workflow on push to main branch
push:
branches:
- main
permissions:
contents: write
# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
build-and-deploy-book:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Install dependencies
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -U "jupyter-book>=0.15,<2"
# Build the book
- name: Build the book
run: |
python --version
jupyter-book --version
jupyter-book build book
# Upload a build log
- name: Upload build log
if: always()
uses: actions/upload-artifact@v4
with:
name: jb-build-log
path: jb_build.log
# Debug build tree
- name: Debug build tree
if: always()
run: |
ls -la book
find book -maxdepth 3 -type d -print
find book -maxdepth 5 -type f -name "*.log" -print
# Verify build site exists
- name: Verify build site exists
run: |
test -f book/_build/html/index.html
echo "Found book/_build/html/index.html"
ls -la book/_build/html | head
# Debug publish_dir
- name: Debug publish_dir
run: |
ls -la book/_build || true
ls -la book/_build/html || true
find book/_build/html -maxdepth 2 -type f | head -n 30 || true
# Debug build output
- name: Debug build output
if: always()
run: |
ls -la book
ls -la book/_build || true
ls -la book/_build/html || true
find book -maxdepth 4 -type f -name "index.html" -print
# Deploy the book's HTML to gh-pages branch
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: book/_build/html
force_orphan: true