1919 uses : actions/checkout@v4
2020 with :
2121 fetch-depth : 0 # Fetch all history for all tags and branches
22- - name : Get docstrings_common.json from master branch of opm-common
23- run : |
24- curl -L -o python/docstrings_common.json https://raw.githubusercontent.com/OPM/opm-common/master/python/docstrings_common.json
25- - name : Get docstrings_common.json from master branch of opm-simulators
26- run : |
27- curl -L -o python/docstrings_simulators.json https://raw.githubusercontent.com/OPM/opm-simulators/master/python/docstrings_simulators.json
28- - 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.
29- run : |
30- curl -L -o dune.module https://raw.githubusercontent.com/OPM/opm-simulators/master/dune.module
3122 - name : Set up Python
3223 uses : actions/setup-python@v5
3324 with :
@@ -38,38 +29,38 @@ jobs:
3829 run : |
3930 cd python/sphinx_docs
4031 poetry install
41- - name : Build documentation
32+ - name : Build documentation for all branches but master
33+ # To add a new relase to this build system:
34+ # - add the respective branch <your-new-release> on this repository
35+ # - take a snapshot of https://raw.githubusercontent.com/OPM/opm-common/<your-new-release>/python/docstrings_common.json,
36+ # https://raw.githubusercontent.com/OPM/opm-simulators/<your-new-release>/python/docstrings_simulators.json and
37+ # https://raw.githubusercontent.com/OPM/opm-simulators/<your-new-release>/dune.module and put them
38+ # in the python folder on that branch
39+ # - add the respective branch <your-new-release> in the command "poetry run sphinx-versioned -b ...." below
4240 run : |
4341 cd python
4442 mkdir gh-pages
4543 touch gh-pages/.nojekyll
4644 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-
45+ poetry run sphinx-versioned -b "release/2025.04" --force --git-root ../../
46+ - name : Get docstrings_common.json, docstrings_simulators.json and dune.module from master branches of opm-common and opm-simulators
47+ run : |
48+ curl -L -o python/docstrings_common.json https://raw.githubusercontent.com/OPM/opm-common/master/python/docstrings_common.json
49+ curl -L -o python/docstrings_simulators.json https://raw.githubusercontent.com/OPM/opm-simulators/master/python/docstrings_simulators.json
50+ curl -L -o dune.module https://raw.githubusercontent.com/OPM/opm-simulators/master/dune.module
51+ - name : Build documentation for master
52+ run : |
53+ cd python/sphinx_docs
54+ poetry install
5555 if [ "${{ github.ref_name }}" == "master" ]; then
56- poetry run sphinx-versioned -m master -b "master" --force --git-root ../../
57- else
58- poetry run sphinx-versioned -m master -b "master ${{ github.ref_name }}" --force --git-root ../../
56+ poetry run sphinx-build -b html docs ../../gh-pages/master
5957 fi
6058 - name : Copy documentation to gh-pages
6159 run : |
6260 cp -r python/sphinx_docs/docs/_build/* python/gh-pages
63-
6461 - name : Deploy documentation for PR merge to master or push to master
6562 if : github.ref == 'refs/heads/master'
6663 uses : OPM/github-pages-deploy-action@releases/v4
6764 with :
6865 branch : gh-pages
6966 folder : python/gh-pages
70- - name : Deploy documentation for other branches (on forks)
71- if : github.event_name == 'push' && github.ref != 'refs/heads/master'
72- uses : OPM/github-pages-deploy-action@releases/v4
73- with :
74- branch : gh-pages-${{ github.ref_name }}
75- folder : python/gh-pages
0 commit comments