@@ -19,15 +19,18 @@ jobs:
1919 uses : actions/checkout@v4
2020 with :
2121 fetch-depth : 0 # Fetch all history for all tags and branches
22+ - name : Create tmp directories for master
23+ run : |
24+ mkdir python/master-tmp
2225 - name : Get docstrings_common.json from master branch of opm-common
2326 run : |
24- curl -L -o python/docstrings_common.json https://raw.githubusercontent.com/OPM/opm-common/master/python/docstrings_common.json
27+ curl -L -o python/master-tmp/ docstrings_common.json https://raw.githubusercontent.com/OPM/opm-common/master/python/docstrings_common.json
2528 - name : Get docstrings_common.json from master branch of opm-simulators
2629 run : |
27- curl -L -o python/docstrings_simulators.json https://raw.githubusercontent.com/OPM/opm-simulators/master/python/docstrings_simulators.json
30+ curl -L -o python/master-tmp/ docstrings_simulators.json https://raw.githubusercontent.com/OPM/opm-simulators/master/python/docstrings_simulators.json
2831 - name : Get dune.module from master branch of opm-simulators, this is needed for the call to extract_opm_simulators_release in python/sphinx_docs/docs/conf.py.
2932 run : |
30- curl -L -o dune.module https://raw.githubusercontent.com/OPM/opm-simulators/master/dune.module
33+ curl -L -o python/master-tmp/ dune.module https://raw.githubusercontent.com/OPM/opm-simulators/master/dune.module
3134 - name : Set up Python
3235 uses : actions/setup-python@v5
3336 with :
@@ -44,18 +47,18 @@ jobs:
4447 mkdir gh-pages
4548 touch gh-pages/.nojekyll
4649 cd sphinx_docs
47- # Currently we build only docs for the HEAD of the master branch
48- # Later we can add release tags to the list to get the docs for the releases
49- # For example: -b "master, release/2024.04/final" will build the docs for
50- # the master branch and the release/2024.04/final tag
51- # For the releases, we create snapshots of the docstrings_common.json and docstrings_simulators.json
52- # and take the ones tracked by git, only for the master, we take the current ones we fetched
53- # in steps 2 and 3 of this workflow
54-
50+ # To add a new relase to this build system:
51+ # - add the respective branch <your-new-release> on this repository, replace the slashes "/" by dashes "-"
52+ # (slashes mess with the navigation html created by sphinx-versioned)
53+ # - take a snapshot of https://raw.githubusercontent.com/OPM/opm-common/<your-new-release>/python/docstrings_common.json,
54+ # https://raw.githubusercontent.com/OPM/opm-simulators/<your-new-release>/python/ docstrings_simulators.json and
55+ # https://raw.githubusercontent.com/OPM/opm-simulators/<your-new-release>/dune.module and put them
56+ # in the python folder on that branch
57+ # - add the respective branch <your-new-release> in the command below
5558 if [ "${{ github.ref_name }}" == "master" ]; then
56- poetry run sphinx-versioned -m master -b "master" --force --git-root ../../
59+ poetry run sphinx-versioned -m master -b "master release-2025.04 " --force --git-root ../../
5760 else
58- poetry run sphinx-versioned -m master -b "master ${{ github.ref_name }}" --force --git-root ../../
61+ poetry run sphinx-versioned -m ${{ github.ref_name }} -b "${{ github.ref_name }} release-2025.04 " --force --git-root ../../
5962 fi
6063 - name : Copy documentation to gh-pages
6164 run : |
6871 branch : gh-pages
6972 folder : python/gh-pages
7073 - name : Deploy documentation for other branches (on forks)
71- if : github.event_name == 'push' && github.ref != 'refs/heads/master'
74+ if : github.event_name == 'push' && github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/release')
7275 uses : OPM/github-pages-deploy-action@releases/v4
7376 with :
7477 branch : gh-pages-${{ github.ref_name }}
0 commit comments