add script/ipynb/html #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: {} | |
permissions: | |
pull-requests: write | |
contents: write | |
pages: write | |
id-token: write | |
env: | |
UV_SYSTEM_PYTHON: 1 | |
jobs: | |
export-notebooks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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: π 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 }} | |
steps: | |
- name: π₯ Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: github-pages | |
- name: π¦ Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: π Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: public | |
- name: π Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |