Skip to content

Commit d607e82

Browse files
author
Lisa Julia Nebel
committed
Properly build
1 parent 215e18d commit d607e82

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

.github/workflows/python_sphinx_docs.yml

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,45 @@ jobs:
1818
- name: Checkout source code
1919
uses: actions/checkout@v4
2020
with:
21-
fetch-depth: 0 # Fetch all history for all tags and branches
21+
fetch-depth: 0
22+
2223
- name: Set up Python
2324
uses: actions/setup-python@v5
2425
with:
2526
python-version: "3.11"
27+
2628
- name: Install poetry
2729
uses: OPM/actions-poetry@master
28-
- name: Install python dependencies
30+
31+
- name: Install Python dependencies
2932
run: |
3033
cd python/sphinx_docs
3134
poetry install
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
35+
36+
- name: Create output directory
37+
run: |
38+
mkdir -p python/gh-pages
39+
touch python/gh-pages/.nojekyll
40+
41+
- name: Build docs for release/2025.04
4042
run: |
41-
cd python
42-
mkdir gh-pages
43-
touch gh-pages/.nojekyll
44-
cd sphinx_docs
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
43+
cd python/sphinx_docs
44+
poetry run sphinx-versioned -b "release/2025.04" --force --git-root ../../ --build-dir ../../gh-pages/release-2025.04
45+
46+
- name: Download files for master build
47+
if: github.ref_name == 'master'
4748
run: |
4849
curl -L -o python/docstrings_common.json https://raw.githubusercontent.com/OPM/opm-common/master/python/docstrings_common.json
4950
curl -L -o python/docstrings_simulators.json https://raw.githubusercontent.com/OPM/opm-simulators/master/python/docstrings_simulators.json
5051
curl -L -o dune.module https://raw.githubusercontent.com/OPM/opm-simulators/master/dune.module
51-
- name: Build documentation for master
52+
53+
- name: Build docs for master
54+
if: github.ref_name == 'master'
5255
run: |
5356
cd python/sphinx_docs
54-
poetry install
55-
if [ "${{ github.ref_name }}" == "master" ]; then
56-
poetry run sphinx-build -b html docs ../../gh-pages/master
57-
fi
58-
- name: Copy documentation to gh-pages
59-
run: |
60-
cp -r python/sphinx_docs/docs/_build/* python/gh-pages
61-
- name: Deploy documentation for PR merge to master or push to master
57+
poetry run sphinx-build -b html docs ../../gh-pages/master
58+
59+
- name: Deploy to GitHub Pages
6260
if: github.ref == 'refs/heads/master'
6361
uses: OPM/github-pages-deploy-action@releases/v4
6462
with:

0 commit comments

Comments
 (0)