Skip to content

Commit 7527af6

Browse files
committed
Add myst CI
1 parent 526760b commit 7527af6

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

.github/workflows/myst_ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: MyST GitHub Pages Deploy
2+
on:
3+
push:
4+
branches: [myst_build]
5+
env:
6+
BASE_URL: /${{ github.event.repository.name }}
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
concurrency:
13+
group: 'pages'
14+
cancel-in-progress: false
15+
jobs:
16+
deploy:
17+
environment:
18+
name: github-pages
19+
url: ${{ steps.deployment.outputs.page_url }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Setup Pages
24+
uses: actions/configure-pages@v3
25+
- name: Cache Notebook Execution
26+
uses: actions/cache@v3
27+
id: cache-execution
28+
with:
29+
path: ./lectures/_build/execute
30+
key: ${{ runner.os }}-execute-cache-${{ hashFiles('lectures/**/*.md') }}
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: 18.x
34+
- name: Install Python
35+
if: steps.cache-execution.outputs.cache-hit != 'true'
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: '3.12'
39+
cache: 'pip'
40+
cache-dependency-path: 'myst_requirements.txt'
41+
- name: Install execution requirements for ipykernel and jupyter-server
42+
if: steps.cache-execution.outputs.cache-hit != 'true'
43+
run: python -m pip install -r myst_requirements.txt
44+
shell: bash
45+
- name: Install MyST Markdown
46+
run: npm install -g mystmd
47+
- name: Build HTML Assets
48+
working-directory: ./lectures
49+
run: myst build --html --execute
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: './lectures/_build/html'
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

myst_requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
jupyter-server
2+
ipykernel
3+
numpy
4+
scipy
5+
matplotlib
6+
pandas
7+
quantecon
8+
sympy

0 commit comments

Comments
 (0)