-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (87 loc) · 2.46 KB
/
export-notebooks.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Export Notebooks
on:
# Trigger on new releases from marimo-team/marimo
repository_dispatch:
types: [marimo-release]
# Trigger on push to main, but ignore if in generated files
push:
branches: [main]
paths-ignore:
- 'generated/**'
- 'public/**'
# Trigger nightly
schedule:
- cron: '0 0 * * *' # Run at midnight UTC
# Allow manual trigger
workflow_dispatch: {}
env:
UV_SYSTEM_PYTHON: 1
jobs:
export-notebooks:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🚀 Install uv
uses: astral-sh/setup-uv@v4
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: 📦 Install marimo
run: |
uv pip install marimo
uv pip install nbformat polars altair vega_datasets matplotlib pandas
- name: 📂 Clone marimo examples
run: |
git clone --depth 1 --filter=blob:none --sparse https://github.com/marimo-team/marimo.git
cd marimo
git sparse-checkout set examples
cd ..
mv marimo/examples .
rm -rf marimo
- name: 🛠️ Run export script
run: |
uv run scripts/export_notebooks.py
- name: 📄 List changed files
continue-on-error: true
run: |
echo "Changed files:"
git diff --name-only HEAD^ HEAD
- name: 📦 Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: public
- name: 🔄 Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: 'Update exported notebooks'
branch: update-exported-notebooks
title: 'Update exported notebooks'
body: 'This PR updates the exported notebooks.'
labels: |
automated
assignees: |
mscolnick
add-paths: |
generated/*
public/*
deploy:
needs: export-notebooks
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: 🌐 Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: github-pages