Skip to content

Publish Jupyter notebook to Github pages #2078

Publish Jupyter notebook to Github pages

Publish Jupyter notebook to Github pages #2078

name: "Publish Jupyter notebook to Github pages"
on:
push:
branches:
- main
repository_dispatch:
types: [generate-ghpages]
workflow_dispatch:
workflow_run:
workflows: ["Merge pharmacies from AFMPS & OSM"]
types:
- completed
jobs:
generate_ghpages:
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: 🔨 Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: 🚧 Install dependencies
run: pip3 install -r requirements.txt
- name: 🤖 Build index.html
run: jupyter nbconvert --to html --TemplateExporter.exclude_input=True --no-prompt --execute pharmacies.ipynb --output index.html
- name: 🕊️ Move files
run: |
mkdir ./public
mv ./index.html ./public/
- name: 📬 Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public