Skip to content

demo3 loads model from file #3

demo3 loads model from file

demo3 loads model from file #3

name: Convert Jupyter Notebook to HTML
on:
push:
paths:
- 'notebooks/demo.ipynb'
- 'notebooks/cell_sorting.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 notebooks/demo.ipynb
jupyter nbconvert --to html notebooks/cell_sorting.ipynb
- name: Commit and push HTML to gh-pages branch
run: |
git config --local user.email "eagmon@github.com"
git config --local user.name "GitHub Action"
git fetch origin
mv notebooks/demo.html /tmp/demo.html
mv notebooks/cell_sorting.html /tmp/cell_sorting.html
git checkout gh-pages || git checkout -b gh-pages
git pull origin gh-pages
mv /tmp/demo.html notebooks/demo.html
mv /tmp/cell_sorting.html notebooks/cell_sorting.html
git add notebooks/demo.html
git add notebooks/cell_sorting.html
git diff-index --quiet HEAD || git commit -m "Update HTML files"
git push origin gh-pages || true