From e1b834e9504a05f9a38bf35021b303facf072a3e Mon Sep 17 00:00:00 2001 From: appleb_m Date: Tue, 31 Mar 2026 13:34:23 +0200 Subject: [PATCH] Update .gitea/workflows/action.yaml Update autodoc deployment workflow --- .gitea/workflows/action.yaml | 66 +++++++----------------------------- 1 file changed, 12 insertions(+), 54 deletions(-) diff --git a/.gitea/workflows/action.yaml b/.gitea/workflows/action.yaml index eeb8928b..775f4148 100644 --- a/.gitea/workflows/action.yaml +++ b/.gitea/workflows/action.yaml @@ -64,68 +64,26 @@ jobs: python-version: '3.12' - name: Build Sphinx HTML - working-directory: daq/docs + working-directory: docs run: | - # ensure on master git fetch origin master:master || true git checkout master || true - - # create venv one level up and activate it - python3 -m venv ../venv - source ../venv/bin/activate - - # ensure pip and Sphinx are installed in this venv + + python3 -m venv venv + source venv/bin/activate + pip install --upgrade pip - pip install "Sphinx==8.2.3" - pip install myst-parser - pip install sphinx_immaterial - pip install linkify-it-py - + pip install "Sphinx==8.2.3" myst-parser sphinx_immaterial linkify-it-py + if [ -f requirements.txt ]; then pip install -r requirements.txt - elif [ -f ../docs/requirements.txt ]; then - pip install -r ../docs/requirements.txt - else - # fallback to known packages if requirements file is not present - pip install "Sphinx==8.2.3" myst-parser sphinx_immaterial linkify-it-py fi - - - # install project editable without deps (avoid private packages) - pip install -e ../ --no-deps - - # prefer the sphinx-apidoc CLI if available; otherwise try module fallback - if command -v sphinx-apidoc > /dev/null 2>&1; then - sphinx-apidoc -o modules/ ../src --separate --module-first --force --remove-old - else - # module fallback: some Sphinx installs expose the module at sphinx.ext.apidoc - python -m sphinx.ext.apidoc -o modules/ ../src --separate --module-first --force --remove-old - fi - - - # Build HTML (source is '.' because working-directory is docs) - # Run sphinx-build and capture exit code and full output to help debugging if it fails. - sphinx-build -b html . _build/html || { - echo "=== Sphinx build failed with exit $?: showing build output and tree ===" - echo "Contents of docs/ after build attempt:" - ls -la - echo "Contents of daq/docs/_build (if any):" - ls -la _build || true - # If sphinx produced a build log file, print it - if [ -f sphinx-build.log ]; then - echo "---- sphinx-build.log ----" - cat sphinx-build.log - fi - # Exit with non-zero to fail the job (avoid deploying empty site) - exit 1 - } - # Sanity check: ensure HTML output exists before continuing to deploy - if [ ! -d _build/html ] || [ -z "$(ls -A _build/html)" ]; then - echo "ERROR: daq/docs/_build/html does not exist or is empty after successful sphinx-build." - ls -la _build || true - exit 1 - fi + pip install -e .. --no-deps + + sphinx-apidoc -o modules/ ../src/aare --separate --module-first --force --remove-old + + sphinx-build -b html . _build/html - name: Deploy to gitea-pages branch (Gitea) env: