-
-
Notifications
You must be signed in to change notification settings - Fork 30
56 lines (47 loc) · 1.76 KB
/
ci.yml
File metadata and controls
56 lines (47 loc) · 1.76 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
name: Build Project [using jupyter-book]
on: [pull_request]
jobs:
preview:
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=quantecon_ubuntu2404/disk=large"
steps:
- uses: actions/checkout@v6
- name: Setup GitHub Pages
uses: actions/configure-pages@v3
- name: Cache Notebook Execution
uses: actions/cache@v3
id: cache-execution
with:
path: ./lectures/_build/execute
key: ${{ runner.os }}-execute-cache-${{ hashFiles('lectures/**/*.md') }}
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install Python
if: steps.cache-execution.outputs.cache-hit != 'true'
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: 'myst_requirements.txt'
- name: Install execution requirements
if: steps.cache-execution.outputs.cache-hit != 'true'
run: python -m pip install -r myst_requirements.txt
- name: Install jupyter book 2.0
run: pip install "jupyter-book>=2.0.0a0"
- name: Build HTML
working-directory: ./lectures
run: jupyter book build --html --execute
- name: Upload build output
uses: actions/upload-artifact@v6
with:
path: './lectures/_build/html'
- name: Preview Deploy to Netlify
uses: nwtgck/actions-netlify@v3
with:
publish-dir: './lectures/_build/html'
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Preview Deploy from GitHub Actions"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}