Skip to content

Fix broken colab links #33

Fix broken colab links

Fix broken colab links #33

Workflow file for this run

name: Quarto Render & Deploy
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# ===== Install Quarto CLI (>=1.6) =====
- uses: quarto-dev/quarto-actions/setup@v2
with:
version: "1.7.3" # pin or use 'release'
# Ensure the APT-installed binary shadows any pip shim
- run: echo "PATH=/usr/bin:${PATH}" >> $GITHUB_ENV
# Install quarto-live extension each build (fast)
- run: quarto add --no-prompt r-wasm/quarto-live
# ── NEW: install Python & Jupyter for notebook support ──
- name: Setup Python for Quarto
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Jupyter dependencies
run: |
python -m pip install --upgrade pip
pip install jupyter nbformat nbclient jupyter-cache
# (Optional) install python & deps if you execute notebooks
# - uses: actions/setup-python@v5
# with: { python-version: '3.11' }
# - run: pip install -r requirements.txt
- name: Normalize notebooks for Quarto
run: |
pip install nbformat
python3 - << 'EOF'
import glob, nbformat
for path in glob.glob("**/*.ipynb", recursive=True):
nb = nbformat.read(path, as_version=4)
changed = False
# 1) strip out the VSCode cell “id” field
for cell in nb.cells:
if cell.get("id", None) is not None:
cell.pop("id", None)
changed = True
# 2) force a known kernel
ks = nb.metadata.get("kernelspec", {})
if ks.get("name") != "python3":
nb.metadata["kernelspec"] = {
"name":"python3", "display_name":"Python 3", "language":"python"
}
changed = True
if changed:
nbformat.write(nb, path)
EOF
# ===== Render the site =====
- name: Render
run: quarto render
# ===== Deploy to gh-pages =====
- name: Publish
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: docs