Skip to content

Commit 02acfa3

Browse files
adjust workflow
1 parent 6ddffa8 commit 02acfa3

File tree

1 file changed

+5
-28
lines changed

1 file changed

+5
-28
lines changed

.github/workflows/publish-marimo.yml

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [master]
66
paths:
7-
- '**/*.py' # Trigger on any Python file changes in any directory
7+
- 'data_science_tools/polars_vs_pandas.py' # Only trigger on this specific file
88

99
jobs:
1010
build:
@@ -26,34 +26,11 @@ jobs:
2626
# Install any other dependencies needed by your notebooks
2727
pip install pandas polars
2828
29-
- name: Export marimo notebooks
29+
- name: Export marimo notebook
3030
run: |
31-
mkdir -p marimo_notebooks
32-
# Get list of changed files that match the path pattern
33-
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep "\.py$" || true)
34-
35-
# Loop through each changed file
36-
for notebook in $CHANGED_FILES; do
37-
if [ -f "$notebook" ] && grep -q "import marimo" "$notebook"; then
38-
echo "Exporting notebook: $notebook"
39-
# Create subdirectory structure to maintain organization
40-
output_dir="marimo_notebooks/$(dirname "$notebook")"
41-
mkdir -p "$output_dir"
42-
marimo export html-wasm "$notebook" --output "$output_dir" --mode run
43-
fi
44-
done
45-
46-
# Create an index.html that lists all notebooks
47-
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><ul>" > marimo_notebooks/index.html
48-
49-
# Find all HTML files and add them to the index
50-
find marimo_notebooks -name "*.html" ! -name "index.html" | sort | while read -r file; do
51-
rel_path="${file#marimo_notebooks/}"
52-
name=$(basename "$file" .html)
53-
echo "<li><a href=\"$rel_path\">$rel_path</a></li>" >> marimo_notebooks/index.html
54-
done
55-
56-
echo "</ul></body></html>" >> marimo_notebooks/index.html
31+
mkdir -p marimo_notebooks/
32+
# Export the specific notebook
33+
marimo export html-wasm "data_science_tools/polars_vs_pandas.py" --output marimo_notebooks/ --mode run
5734
5835
- name: 📦 Upload Pages Artifact
5936
uses: actions/upload-pages-artifact@v3

0 commit comments

Comments
 (0)