Skip to content

Update deploy.yml

Update deploy.yml #40

Workflow file for this run

name: deploy
on:
# Trigger the workflow on push to main branch
push:
branches:
- main
permissions:
contents: write
# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
build-and-deploy-book:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Install dependencies
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install jupyter-book
# Build the book
- name: Build the book
run: |
python --version
jupyter-book --version
jupyter-book build book
# Debug build output
- name: Debug build output
if: always()
run: |
ls -la book
ls -la book/_build || true
ls -la book/_build/html || true
find book -maxdepth 4 -type f -name "index.html" -print
# Deploy the book's HTML to gh-pages branch
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: book/_build/html
force_orphan: true