From 3d625bc47ef5ce70090dd94ed03c8b0a6022c494 Mon Sep 17 00:00:00 2001 From: Henrik Kjedsberg Date: Mon, 30 Sep 2024 22:22:43 +0200 Subject: [PATCH 1/3] Update deploy docs workflow --- .github/workflows/deploy_pages.yml | 65 ++++++++++-------------------- 1 file changed, 21 insertions(+), 44 deletions(-) diff --git a/.github/workflows/deploy_pages.yml b/.github/workflows/deploy_pages.yml index 53a94fe..e1f7ec7 100644 --- a/.github/workflows/deploy_pages.yml +++ b/.github/workflows/deploy_pages.yml @@ -3,65 +3,42 @@ name: GitHub pages on: # Trigger the workflow on push to main branch push: - branches: - - main - - update-books +# 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 @@ -70,7 +47,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 From 01f3d9ad593cc45d77fd443df706cfb580abaf80 Mon Sep 17 00:00:00 2001 From: Henrik Kjedsberg Date: Mon, 30 Sep 2024 22:28:52 +0200 Subject: [PATCH 2/3] Pin sphinx version --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 5235316..550a1f0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ jupyter-book matplotlib numpy ghp-import +sphinx==5.3.0 \ No newline at end of file From be574d7497f544e0e4253ba5baa2b4f092e1ae79 Mon Sep 17 00:00:00 2001 From: Henrik Kjedsberg Date: Mon, 30 Sep 2024 22:31:27 +0200 Subject: [PATCH 3/3] Deploy book on push to main --- .github/workflows/deploy_pages.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_pages.yml b/.github/workflows/deploy_pages.yml index e1f7ec7..d0b0289 100644 --- a/.github/workflows/deploy_pages.yml +++ b/.github/workflows/deploy_pages.yml @@ -3,9 +3,8 @@ name: GitHub pages on: # Trigger the workflow on push to main branch push: -# branches: -# - main -# - update-books + branches: + - main # This job installs dependencies, build the book, and pushes it to `gh-pages` jobs: