Skip to content

Commit

Permalink
Merge pull request #33 from KVSlab/fix-doc
Browse files Browse the repository at this point in the history
Update documentation workflow
  • Loading branch information
hkjeldsberg authored Sep 30, 2024
2 parents 1a0b5c4 + be574d7 commit 337df4d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 42 deletions.
60 changes: 18 additions & 42 deletions .github/workflows/deploy_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,63 +5,39 @@ on:
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}
include:
- os: macos-13
label: osx-64
prefix: /Users/runner/miniconda3/envs/oasismove-env

name: Build OasisMove documentation ${{ matrix.label }}
name: Build OasisMove documentation ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run: # https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
shell: bash -el {0}

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
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
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'
environment-file: environment.yml
init-shell: bash
cache-environment: true

- name: Install dependencies
- name: Install docs requirements
run: |
pip install -r requirements.txt
python -m pip install -r requirements.txt
- name: Install OasisMove
run: python3 -m pip install .[test]
run: |
python -m pip install '.[test]'
# https://github.com/executablebooks/jupyter-book/issues/1997
- name: Downgrade docutils to fix layout-bug
Expand All @@ -70,7 +46,7 @@ jobs:
# Build the book
- name: Build the book
run: |
jupyter book build docs
jupyter-book build docs
# Deploy the book's HTML to gh-pages branch
- name: GitHub Pages action
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ jupyter-book
matplotlib
numpy
ghp-import
sphinx==5.3.0

0 comments on commit 337df4d

Please sign in to comment.