Merge branch 'main' of github.com:KVSlab/OasisMove #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitHub pages | |
on: | |
# Trigger the workflow on push to main branch | |
push: | |
branches: | |
- main | |
- update-books | |
# This job installs dependencies, build the book, and pushes it to `gh-pages` | |
jobs: | |
build-and-deploy-book: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
label: linux-64 | |
prefix: /usr/share/miniconda3/envs/oasismove | |
# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell | |
defaults: | |
run: | |
shell: bash -l {0} | |
name: Build OasisMove documentation ${{ matrix.label }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Upgrade pip and setuptools | |
run: | | |
python3 -m pip install pip setuptools --upgrade | |
# See: https://github.com/marketplace/actions/setup-miniconda | |
- name: Setup Mambaforge | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
channels: conda-forge | |
activate-environment: oasismove | |
use-mamba: true | |
- name: Set cache date | |
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
- uses: actions/cache@v2 | |
with: | |
path: ${{ matrix.prefix }} | |
key: ${{ matrix.label }}-conda-${{ hashFiles('environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }} | |
id: cache | |
- name: Update environment | |
run: mamba env update -n oasismove -f environment.yml | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Install OasisMove | |
run: python3 -m pip install .[test] | |
# https://github.com/executablebooks/jupyter-book/issues/1997 | |
- name: Downgrade docutils to fix layout-bug | |
run: python3 -m pip install docutils==0.17.1 | |
# Build the book | |
- name: Build the book | |
run: | | |
jupyter book build docs | |
# Deploy the book's HTML to gh-pages branch | |
- name: GitHub Pages action | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/_build/html |