@@ -53,19 +53,20 @@ jobs:
5353 mkdir gh-pages
5454 touch gh-pages/.nojekyll
5555 cd sphinx_docs
56- # To add a new relase to this build system:
56+ # To add a new release to this build system:
5757 # - add the respective branch <your-new-release> on this repository, replace the slashes "/" by dashes "-"
5858 # (slashes mess with the navigation html created by sphinx-versioned)
5959 # - take a snapshot of https://raw.githubusercontent.com/OPM/opm-common/<your-new-release>/python/docstrings_common.json,
6060 # https://raw.githubusercontent.com/OPM/opm-simulators/<your-new-release>/python/docstrings_simulators.json and
6161 # https://raw.githubusercontent.com/OPM/opm-simulators/<your-new-release>/dune.module and put them
6262 # in the python folder on that branch
63- # - add the respective branch <your-new-release> in the command below
64- if [ "${{ github.ref_name }}" == "master" ]; then
65- poetry run sphinx-versioned -m master -b "master release-2025.04" --force --git-root ../../
66- else
67- poetry run sphinx-versioned -m master -b "${{ github.ref_name }} master release-2025.04" --force --git-root ../../
68- fi
63+ # Once created, the script below will automatically detect and include the new release branch
64+
65+ # Dynamically determine which branches to build documentation for
66+ # This allows the workflow to work on forks that may not have all release branches
67+ BRANCHES=$(../scripts/get_doc_branches.sh "${{ github.ref_name }}")
68+ echo "Building documentation for branches: $BRANCHES"
69+ poetry run sphinx-versioned -m master -b "$BRANCHES" --force --git-root ../../
6970 - name : Copy documentation to gh-pages
7071 run : |
7172 cp -r python/sphinx_docs/docs/_build/* python/gh-pages
0 commit comments