From 8241561fd60bbf70b7608b51f59c497566191015 Mon Sep 17 00:00:00 2001 From: Federico Perini Date: Sat, 1 Mar 2025 19:54:38 +0100 Subject: [PATCH] fix python env for pages --- .github/workflows/preview.yml | 12 ++++++++++-- .github/workflows/sphinx.yml | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 8cbabcb97..9b47db929 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -26,6 +26,12 @@ jobs: uses: mamba-org/setup-micromamba@v1 with: environment-file: environment.yaml + environment-name: docs + create-args: >- + python=3.9 + sphinx + sphinxcontrib-serializinghtml + setuptools - name: Safe workflow for build preview run: if [ -d "_build" ]; then rm -rf _build; fi @@ -33,11 +39,12 @@ jobs: - name: Build page and Translations if: contains(github.event.comment.body, '#preview') run: | + micromamba activate docs + python -c "import imghdr" # Check if imghdr is available make gettext html - name: Create nojekyll file - run: | - touch _build/.nojekyll + run: touch _build/.nojekyll - name: Deploy documentation sphinx uses: JamesIves/github-pages-deploy-action@v4.5.0 @@ -55,3 +62,4 @@ jobs: with: issue-number: ${{github.event.issue.number}} body: "This PR has been built with Sphinx and can be previewed at: https://fortran-lang.github.io/fpm/pr/${{github.event.issue.number}}" + diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index 5d2fc1282..b6e1b4e44 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -28,9 +28,17 @@ jobs: uses: mamba-org/setup-micromamba@v1 with: environment-file: environment.yaml - - - name: Build pages + environment-name: docs + create-args: >- + python=3.9 + sphinx + sphinxcontrib-serializinghtml + setuptools + + - name: Activate environment and build pages run: | + micromamba activate docs + python -c "import imghdr" make gettext html - name: Create nojekyll file