-
Notifications
You must be signed in to change notification settings - Fork 199
91 lines (73 loc) · 2.94 KB
/
build_book.yml
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
90
91
name: Build book
on: [push, pull_request]
concurrency: preview-${{ github.ref }}
env:
PREVIEW_BRANCH: gh-pages
jobs:
build-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup environment
run: |
pip install uv
uv pip install --system jupyter-book jupytext beautifulsoup4
- name: Cache jupyter-cache folder
uses: actions/cache@v2
env:
cache-name: jupyter-cache
with:
path: jupyter-book/_build/.jupyter_cache
key: v1-${{ github.ref }}-${{ hashFiles('notebook_scripts/**/*.py') }}
restore-keys: |
v1-${{ github.ref }}-${{ hashFiles('notebook_scripts/**/*.py') }}
v1-${{ github.ref }}
v1-refs/heads/master
- name: Build the JupyterBook
run: make
- name: Deploy PR preview
id: preview-step
uses: rossjrw/pr-preview-action@v1
if: github.event_name == 'pull_request' && github.event.action != 'closed'
with:
source-dir: ./jupyter-book/_build/html
preview-branch: ${{ env.PREVIEW_BRANCH }}
comment: false
- name: Add Sticky PR Comment for Preview
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request' && github.event.action != 'closed'
with:
header: pr-preview
message: |
[PR Preview Action](https://github.com/rossjrw/pr-preview-action) ${{ steps.preview-step.outputs.action-version }}
:---:
| <p></p> :dna: View preview of single-cell best practices at <br> ${{ steps.preview-step.outputs.preview-url }} <br><br>
| <h6>Built to branch [`${{ env.PREVIEW_BRANCH }}`](${{ github.server_url }}/${{ github.repository }}/tree/${{ env.PREVIEW_BRANCH }}) at ${{ steps.preview-step.outputs.action-start-time }}. <br> Preview will be ready when the [GitHub Pages deployment](${{ github.server_url }}/${{ github.repository }}/deployments) is complete. <br><br> </h6>
pdfhtml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python dependencies
run: |
python -m pip install --upgrade uv
uv pip install --system jupyter-book jupytext beautifulsoup4
- name: Install Headless Chrome dependencies
run: |
sudo apt-get update
sudo apt-get install -yq $(cat .github/workflows/pyppeteer_requirements.txt)
- name: Install Chromium
run: uv pip install --system pyppeteer
- name: Build PDF from HTML (Docs)
run: make pdf
- uses: actions/upload-artifact@v4
with:
name: PDF_HTML
path: jupyter-book/_build/pdf/book.pdf