edit marimo notebook #2
This file contains hidden or 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: Publish Marimo Notebooks | |
on: | |
push: | |
branches: [ main, master ] | |
paths: | |
- 'data_science_tools/polars_vs_pandas.py' # Only trigger on changes to this specific file | |
workflow_dispatch: # Allow manual triggering | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install marimo | |
# Install any other dependencies needed by your notebooks | |
pip install pandas numpy polars | |
- name: Export marimo notebook | |
run: | | |
mkdir -p _site/data_science_tools | |
# Export the specific notebook to HTML | |
marimo export "data_science_tools/polars_vs_pandas.py" --format html --output "_site/data_science_tools/polars_vs_pandas.html" | |
# Create a simple index.html | |
echo "<html><head><title>Marimo Notebooks</title><style>body{font-family:sans-serif;max-width:800px;margin:0 auto;padding:20px}h1{color:#0066cc}</style></head><body><h1>Marimo Notebooks</h1><p><a href=\"data_science_tools/polars_vs_pandas.html\">Polars vs Pandas</a></p></body></html>" > _site/index.html | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: _site | |
branch: gh-pages |