Skip to content

Instantly share code, notes, and snippets.

@mwakok
Created December 17, 2021 16:39
Show Gist options
  • Save mwakok/afeeb6d45bb23eda6f7cad7e0ad4bb22 to your computer and use it in GitHub Desktop.
Save mwakok/afeeb6d45bb23eda6f7cad7e0ad4bb22 to your computer and use it in GitHub Desktop.
Workflow to publish a jupyterbook
name: deploy-book
# Only run this when the master branch
on:
push:
branches:
- main
# Option to runa ction manually
workflow_dispatch:
inputs:
tag:
description: Tag for manually deploying jupyterbook
required: False
default: ''
# This job installs dependencies, builds the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install dependencies
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
pip install -e .[dev]
# Build the book
- name: Build the book
run: |
jupyter-book build ./jupyter_book
# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v3.6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./jupyter_book/_build/html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment