Skip to content

Commit

Permalink
run notebook, add workflow to convert to html, link on readme
Browse files Browse the repository at this point in the history
  • Loading branch information
eagmon committed Sep 12, 2024
1 parent 5f91532 commit 4f84855
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 26 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/notebook_to_html.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Convert Jupyter Notebook to HTML

on:
push:
paths:
- 'demo/particle_comets.ipynb'

jobs:
convert:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@main
with:
ref: main
fetch-depth: 0 # Fetch all history to have access to the gh-pages branch

- name: Set up Python
uses: actions/setup-python@main
with:
python-version: 3.x

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install nbconvert
- name: Convert Jupyter Notebook to HTML
run: |
jupyter nbconvert --to html demo/particle_comets.ipynb
- name: Commit and push HTML to gh-pages branch
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git fetch origin
mv demo/particle_comets.html /tmp/particle_comets.html
git checkout gh-pages || git checkout -b gh-pages
git pull origin gh-pages
mv /tmp/particle_comets.html demo/particle_comets.html
git add demo/particle_comets.html
git diff-index --quiet HEAD || git commit -m "Update HTML file"
git push origin gh-pages || true
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Process-Bigraph Template
# Spatio-Flux for Process-Bigraphs

## Demo
* [Particle-COMETS](https://vivarium-collective.github.io/spatio-flux/demo/particle_comets.html)
166 changes: 141 additions & 25 deletions demo/particle_comets.ipynb

Large diffs are not rendered by default.

0 comments on commit 4f84855

Please sign in to comment.