Skip to content

Instantly share code, notes, and snippets.

@NeroBlackstone
Created June 20, 2023 13:13
Show Gist options
  • Select an option

  • Save NeroBlackstone/08de62f55988dfc691bf93f2e1c5d127 to your computer and use it in GitHub Desktop.

Select an option

Save NeroBlackstone/08de62f55988dfc691bf93f2e1c5d127 to your computer and use it in GitHub Desktop.

Revisions

  1. NeroBlackstone created this gist Jun 20, 2023.
    55 changes: 55 additions & 0 deletions book.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,55 @@
    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/actions-gh-pages@v3.9.3
    with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_dir: ./_build/html