Skip to content

Instantly share code, notes, and snippets.

@NeroBlackstone
Created June 20, 2023 13:13
Show Gist options
  • Save NeroBlackstone/08de62f55988dfc691bf93f2e1c5d127 to your computer and use it in GitHub Desktop.
Save NeroBlackstone/08de62f55988dfc691bf93f2e1c5d127 to your computer and use it in GitHub Desktop.
jupyter-book with IJulia kernel github actions
name: deploy-book
# Only run this when the master branch changes
on:
push:
branches:
- master
pull_request:
branches:
- master
# This job installs dependencies, build 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
uses: actions/setup-python@v1
with:
python-version: 3
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Setup Julia
uses: julia-actions/setup-julia@v1
- name: Install IJulia and Julia dependencies
shell: julia --project="" --color=yes {0}
run: |
import Pkg
Pkg.Registry.update()
Pkg.add(["IJulia"])
import IJulia
IJulia.installkernel("Julia", "--project=@.")
Pkg.activate(".")
Pkg.instantiate()
Pkg.resolve()
Pkg.precompile()
# Build the book
- name: Build the book
run: |
jupyter-book build .
# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment