Skip to content

Commit 94dd01c

Browse files
committed
adding jupyterlite deployment
1 parent df465e4 commit 94dd01c

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Deploy Jupyter Notebooks to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
7+
env:
8+
TEMPLATE_REPO: 'DurhamARC-Training/PythonCourse-jupyterlite'
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout template repository
15+
uses: actions/checkout@v4
16+
with:
17+
repository: ${{ env.TEMPLATE_REPO }}
18+
19+
- name: Checkout main repository into content directory
20+
uses: actions/checkout@v4
21+
with:
22+
path: content
23+
24+
- name: Setup Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.11'
28+
29+
- name: Install template dependencies
30+
run: |
31+
python -m pip install -r requirements.txt
32+
33+
- name: Install content dependencies
34+
run: |
35+
if [ -f content/requirements.txt ]; then
36+
echo "Found content/requirements.txt, installing dependencies..."
37+
python -m pip install -r content/requirements.txt
38+
else
39+
echo "No content/requirements.txt found, skipping content dependencies"
40+
fi
41+
42+
- name: Build the JupyterLite site
43+
run: |
44+
cp README.md content
45+
jupyter lite build --contents content --output-dir dist
46+
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v3
49+
with:
50+
path: ./dist
51+
52+
deploy:
53+
needs: build
54+
if: github.ref == 'refs/heads/main'
55+
permissions:
56+
pages: write
57+
id-token: write
58+
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)