Skip to content

Commit

Permalink
added ghaction
Browse files Browse the repository at this point in the history
  • Loading branch information
RichRick1 authored and msricher committed Jan 30, 2024
1 parent fc28206 commit 81d859c
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: deploy-book

# Only run this when the master branch changes
on:
push:
branches:
- master
- websiteupd

pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main
# 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:
#- book/

# This job installs dependencies, builds the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
permissions:
pages: write
# https://github.com/JamesIves/github-pages-deploy-action/issues/1110
contents: write

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies and make C++ library
run: |
python3 -m pip install --user numpy scipy pytest pycodestyle pydocstyle
PYTHON=python3 make
python3 -m pip install .
- name: Install dependencies
run: |
python3 -m pip install -r website/requirements.txt
# Build the documentation
#- name: Build the documentation
# run: |
# cd doc
# make html
# cd ../

# Add soft links to the notebooks
- name: Add soft links to the notebooks
run: |
cd website
ln -s ../notebooks ./examples
ln -s ../doc/source ./api
cd ../
# Build the book
- name: Build the website
run: |
jupyter-book build ./website/
# Push the book's HTML to github-pages
# inspired by https://github.com/orgs/community/discussions/26724
# only push to gh-pages if the master branch has been updated
- name: GitHub Pages Action
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/_build/html
publish_branch: gh-pages

0 comments on commit 81d859c

Please sign in to comment.