Skip to content

Commit 4cdb893

Browse files
committed
Add workflow to deploy to GH pages w/ JupyterLite
1 parent f1d0b16 commit 4cdb893

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: "Deploy to GH Pages with JupyterLite"
2+
3+
on:
4+
# TODO: Remove pull_request trigger
5+
pull_request:
6+
push:
7+
branches: ["main"]
8+
workflow_dispatch:
9+
10+
11+
# Allow one concurrent deployment
12+
concurrency:
13+
group: "pages"
14+
cancel-in-progress: true
15+
16+
17+
env:
18+
UV_SYSTEM_PYTHON: 1
19+
20+
jobs:
21+
build:
22+
name: "python"
23+
runs-on: "ubuntu-latest"
24+
25+
steps:
26+
- uses: "actions/checkout@v5"
27+
- uses: "actions/setup-python@v6"
28+
29+
- name: "Install uv"
30+
uses: "astral-sh/setup-uv@v6"
31+
32+
- name: "Install our extension dependencies"
33+
run: "uv pip install .[dev]"
34+
35+
- name: "Build our extensions"
36+
run: |
37+
jupyter labextension develop . --overwrite
38+
jupyter server extension enable myextension
39+
jlpm build
40+
41+
- name: "Install JupyterLite and Python kernel"
42+
run: "uv pip install jupyterlite jupyterlite-xeus"
43+
44+
- name: "Build JupyterLite"
45+
run: "jupyter lite build"
46+
47+
- name: "Upload site artifact"
48+
uses: "actions/upload-pages-artifact@v3"
49+
with:
50+
path: "./_site"
51+
52+
53+
deploy:
54+
runs-on: "ubuntu-latest"
55+
needs: "build"
56+
environment:
57+
name: "github-pages"
58+
url: "${{ steps.deployment.outputs.page_url }}"
59+
permissions:
60+
pages: "write"
61+
id-token: "write"
62+
steps:
63+
- name: "Deploy to GitHub Pages"
64+
id: "deployment"
65+
uses: "actions/deploy-pages@v4"

0 commit comments

Comments
 (0)