Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-morris committed Jun 13, 2024
1 parent bfbaebf commit 4d67cc3
Showing 1 changed file with 28 additions and 30 deletions.
58 changes: 28 additions & 30 deletions .github/workflows/deploy-book.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
name: deploy-book
name: Publish JupyterBook to GitHub Pages

# Only run this when the main branch changes
on:
push:
on:
push: # trigger build only when push to master
branches:
- master
# If your git repository has the Jupyter Book within some-subfolder next to
# unrelated files, you can make this run only if a file within that specific
# folder has been modified.
#
# paths:
# - some-subfolder/**
- master

# This job installs dependencies, builds the book, and pushes it to `gh-pages`
jobs:
deploy-book:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# Install dependencies
- name: Set up Python 3.11
uses: actions/setup-python@v3
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.11
python-version: 3.7
- name: Install Python dependencies
run: |
sudo apt-get install python3-pip
pip install git+git://github.com/executablebookproject/cli.git#egg=master
pip install ghp-import
PATH="${PATH}:${HOME}/.local/bin"
- name: Install dependencies
- name: Build book TOC file
run: |
pip install -r requirements.txt
jupyter-book toc ./content
# Build the book
- name: Build the book
- name: Build book HTML
run: |
jupyter-book build .
jupyter-book build ./content
# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/html
- name: Push _build/html to gh-pages
run: |
sudo chown -R $(whoami):$(whoami) .
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --global user.name "$GITHUB_ACTOR"
git remote set-url origin "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY"
ghp-import ./content/_build/html -f -p -n

0 comments on commit 4d67cc3

Please sign in to comment.