From 4cf0db2343a4da658be2e8914fac6a1865d26412 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Tue, 21 Oct 2025 16:22:21 +0200 Subject: [PATCH 1/5] pages cicd --- .github/workflows/code.yaml | 35 +++++++++ .pre-commit-config.yaml | 3 +- docs/source/conf.py | 48 ++++++++++-- pyproject.toml | 8 +- src/secop_ophyd/__init__.py | 6 ++ uv.lock | 149 +++++++++++++++++++++++++++++++++++- 6 files changed, 240 insertions(+), 9 deletions(-) diff --git a/.github/workflows/code.yaml b/.github/workflows/code.yaml index fa0e5e5..3a4b69b 100644 --- a/.github/workflows/code.yaml +++ b/.github/workflows/code.yaml @@ -54,6 +54,41 @@ jobs: run: | uv run pytest tests/ -v + publish-pages: + runs-on: ubuntu-latest + #if: ${{startsWith(github.ref, 'refs/tags/')}} # only publish to PyPI on tag pushes + + strategy: + matrix: + python-version: ["3.12"] + fail-fast: false + + steps: + + - name: Set env.REPOSITORY_NAME # just the repo, as opposed to org/repo + shell: bash -l {0} + run: | + export REPOSITORY_NAME=${GITHUB_REPOSITORY#*/} + echo "REPOSITORY_NAME=${REPOSITORY_NAME}" >> $GITHUB_ENV + + - uses: actions/checkout@v4 + + - name: Install uv and set the python version + uses: astral-sh/setup-uv@v6 + with: + python-version: ${{ matrix.python-version }} + + - name: Install secop-ophyd with all deps + run: uv sync --all-extras + + - name: Build Docs + shell: bash -l {0} + run: uv run make -C docs/ html + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + build: name: Build distribution 📦 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 32ff2a3..c827970 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,6 +15,7 @@ repos: rev: 6.1.0 hooks: - id: flake8 + exclude: ^docs/ - repo: https://github.com/PyCQA/isort rev: 6.0.1 @@ -36,4 +37,4 @@ repos: hooks: - id: mypy args: [--config-file=.mypy.ini] - exclude: ^cfg/ + exclude: ^(cfg/|docs/) diff --git a/docs/source/conf.py b/docs/source/conf.py index da3599d..a0948c2 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -6,18 +6,26 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = "SECoP-Ophyd" -copyright = "2024, Peter Wegmann" -author = "Peter Wegmann" -release = "0.0" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ - "sphinx.ext.duration", - "sphinx.ext.doctest", "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.githubpages", + "sphinx.ext.intersphinx", + "sphinx.ext.mathjax", + "sphinx.ext.viewcode", + "IPython.sphinxext.ipython_directive", + "IPython.sphinxext.ipython_console_highlighting", + "matplotlib.sphinxext.plot_directive", + "numpydoc", + "sphinx_click", + "sphinx_copybutton", + "myst_parser", + "sphinxcontrib.jquery", + "sphinxcontrib.mermaid", ] templates_path = ["_templates"] @@ -28,3 +36,31 @@ html_theme = "alabaster" html_static_path = ["_static"] + + +# Generate the API documentation when building +autosummary_generate = True +numpydoc_show_class_members = False + +source_suffix = ".rst" + +master_doc = "index" + +import secop_ophyd + +project = "SECoP-Ophyd" +copyright = "2024, Peter Braun" +author = "Peter Braun" +release = secop_ophyd.__version__ +version = secop_ophyd.__version__ + +language = "en" + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "sphinx_rtd_theme" +import sphinx_rtd_theme diff --git a/pyproject.toml b/pyproject.toml index a727b78..9159df0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,13 @@ dev = [ 'mlzlog', 'python-dotenv', 'bluesky', - 'sphinx', + "sphinx !=4.1.0, !=4.1.1, !=4.1.2, !=4.2.0", + "sphinx-click", + "sphinx-copybutton", + "sphinx_rtd_theme", + "sphinxcontrib-mermaid", + "myst-parser", + "numpydoc", 'snakefmt' ] diff --git a/src/secop_ophyd/__init__.py b/src/secop_ophyd/__init__.py index e69de29..45df6d4 100644 --- a/src/secop_ophyd/__init__.py +++ b/src/secop_ophyd/__init__.py @@ -0,0 +1,6 @@ +from ._version import __version__, __version_tuple__ + +__all__ = [ + "__version__", + "__version_tuple__", +] diff --git a/uv.lock b/uv.lock index 1f7fb94..095b6c6 100644 --- a/uv.lock +++ b/uv.lock @@ -1243,6 +1243,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/a5/a5/f9838fe6aa132cfd22733ed2729d0592259fff074cefb80f19aa0607367b/lz4-4.4.4-cp313-cp313-win_arm64.whl", hash = "sha256:f4c21648d81e0dda38b4720dccc9006ae33b0e9e7ffe88af6bf7d4ec124e2fba", size = 89743, upload-time = "2025-04-01T22:55:49.716Z" }, ] +[[package]] +name = "markdown-it-py" +version = "3.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mdurl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/38/71/3b932df36c1a044d397a1f92d1cf91ee0a503d91e470cbd670aa66b07ed0/markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb", size = 74596, upload-time = "2023-06-03T06:41:14.443Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/42/d7/1ec15b46af6af88f19b8e5ffea08fa375d433c998b8a7639e76935c14f1f/markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1", size = 87528, upload-time = "2023-06-03T06:41:11.019Z" }, +] + [[package]] name = "markupsafe" version = "3.0.3" @@ -1424,6 +1436,27 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/27/1a/1f68f9ba0c207934b35b86a8ca3aad8395a3d6dd7921c0686e23853ff5a9/mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e", size = 7350, upload-time = "2022-01-24T01:14:49.62Z" }, ] +[[package]] +name = "mdit-py-plugins" +version = "0.5.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown-it-py" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b2/fd/a756d36c0bfba5f6e39a1cdbdbfdd448dc02692467d83816dff4592a1ebc/mdit_py_plugins-0.5.0.tar.gz", hash = "sha256:f4918cb50119f50446560513a8e311d574ff6aaed72606ddae6d35716fe809c6", size = 44655, upload-time = "2025-08-11T07:25:49.083Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/86/dd6e5db36df29e76c7a7699123569a4a18c1623ce68d826ed96c62643cae/mdit_py_plugins-0.5.0-py3-none-any.whl", hash = "sha256:07a08422fc1936a5d26d146759e9155ea466e842f5ab2f7d2266dd084c8dab1f", size = 57205, upload-time = "2025-08-11T07:25:47.597Z" }, +] + +[[package]] +name = "mdurl" +version = "0.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, +] + [[package]] name = "mlzlog" version = "0.5.0" @@ -1562,6 +1595,24 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, ] +[[package]] +name = "myst-parser" +version = "4.0.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "docutils" }, + { name = "jinja2" }, + { name = "markdown-it-py" }, + { name = "mdit-py-plugins" }, + { name = "pyyaml" }, + { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/a5/9626ba4f73555b3735ad86247a8077d4603aa8628537687c839ab08bfe44/myst_parser-4.0.1.tar.gz", hash = "sha256:5cfea715e4f3574138aecbf7d54132296bfd72bb614d31168f48c477a830a7c4", size = 93985, upload-time = "2025-02-12T10:53:03.833Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5f/df/76d0321c3797b54b60fef9ec3bd6f4cfd124b9e422182156a1dd418722cf/myst_parser-4.0.1-py3-none-any.whl", hash = "sha256:9134e88959ec3b5780aedf8a99680ea242869d012e8821db3126d427edc9c95d", size = 84579, upload-time = "2025-02-12T10:53:02.078Z" }, +] + [[package]] name = "nest-asyncio" version = "1.6.0" @@ -1755,6 +1806,20 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/95/8e/2844c3959ce9a63acc7c8e50881133d86666f0420bcde695e115ced0920f/numpy-2.3.4-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:81b3a59793523e552c4a96109dde028aa4448ae06ccac5a76ff6532a85558a7f", size = 12973130, upload-time = "2025-10-15T16:18:09.397Z" }, ] +[[package]] +name = "numpydoc" +version = "1.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/2f/19/7721093e25804cc82c7c1cdab0cce6b9343451828fc2ce249cee10646db5/numpydoc-1.9.0.tar.gz", hash = "sha256:5fec64908fe041acc4b3afc2a32c49aab1540cf581876f5563d68bb129e27c5b", size = 91451, upload-time = "2025-06-24T12:22:55.283Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/26/62/5783d8924fca72529defb2c7dbe2070d49224d2dba03a85b20b37adb24d8/numpydoc-1.9.0-py3-none-any.whl", hash = "sha256:8a2983b2d62bfd0a8c470c7caa25e7e0c3d163875cdec12a8a1034020a9d1135", size = 64871, upload-time = "2025-06-24T12:22:53.701Z" }, +] + [[package]] name = "opentelemetry-api" version = "1.38.0" @@ -2796,8 +2861,10 @@ dev = [ { name = "matplotlib" }, { name = "mlzlog" }, { name = "mypy" }, + { name = "myst-parser" }, { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "numpy", version = "2.3.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "numpydoc" }, { name = "ophyd" }, { name = "pep8-naming" }, { name = "pre-commit" }, @@ -2810,6 +2877,10 @@ dev = [ { name = "snakefmt", version = "0.11.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "sphinx-click" }, + { name = "sphinx-copybutton" }, + { name = "sphinx-rtd-theme" }, + { name = "sphinxcontrib-mermaid" }, { name = "wheel" }, ] @@ -2829,7 +2900,9 @@ dev = [ { name = "matplotlib" }, { name = "mlzlog" }, { name = "mypy" }, + { name = "myst-parser" }, { name = "numpy" }, + { name = "numpydoc" }, { name = "ophyd" }, { name = "pep8-naming" }, { name = "pre-commit" }, @@ -2839,7 +2912,11 @@ dev = [ { name = "pytest-xprocess" }, { name = "python-dotenv" }, { name = "snakefmt" }, - { name = "sphinx" }, + { name = "sphinx", specifier = "!=4.1.0,!=4.1.1,!=4.1.2,!=4.2.0" }, + { name = "sphinx-click" }, + { name = "sphinx-copybutton" }, + { name = "sphinx-rtd-theme" }, + { name = "sphinxcontrib-mermaid" }, { name = "wheel" }, ] @@ -2967,6 +3044,49 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/31/53/136e9eca6e0b9dc0e1962e2c908fbea2e5ac000c2a2fbd9a35797958c48b/sphinx-8.2.3-py3-none-any.whl", hash = "sha256:4405915165f13521d875a8c29c8970800a0141c14cc5416a38feca4ea5d9b9c3", size = 3589741, upload-time = "2025-03-02T22:31:56.836Z" }, ] +[[package]] +name = "sphinx-click" +version = "6.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "docutils" }, + { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/de/4b/c433ea57136eac0ccb8d76d33355783f1e6e77f1f13dc7d8f15dba2dc024/sphinx_click-6.1.0.tar.gz", hash = "sha256:c702e0751c1a0b6ad649e4f7faebd0dc09a3cc7ca3b50f959698383772f50eef", size = 26855, upload-time = "2025-09-11T11:05:45.53Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/95/a2fa680f02ee9cbe4532169d2e60b102fe415b6cfa25584ac2d112e4c43b/sphinx_click-6.1.0-py3-none-any.whl", hash = "sha256:7dbed856c3d0be75a394da444850d5fc7ecc5694534400aa5ed4f4849a8643f9", size = 8931, upload-time = "2025-09-11T11:05:43.897Z" }, +] + +[[package]] +name = "sphinx-copybutton" +version = "0.5.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/fc/2b/a964715e7f5295f77509e59309959f4125122d648f86b4fe7d70ca1d882c/sphinx-copybutton-0.5.2.tar.gz", hash = "sha256:4cf17c82fb9646d1bc9ca92ac280813a3b605d8c421225fd9913154103ee1fbd", size = 23039, upload-time = "2023-04-14T08:10:22.998Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9e/48/1ea60e74949eecb12cdd6ac43987f9fd331156388dcc2319b45e2ebb81bf/sphinx_copybutton-0.5.2-py3-none-any.whl", hash = "sha256:fb543fd386d917746c9a2c50360c7905b605726b9355cd26e9974857afeae06e", size = 13343, upload-time = "2023-04-14T08:10:20.844Z" }, +] + +[[package]] +name = "sphinx-rtd-theme" +version = "3.0.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "docutils" }, + { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "sphinxcontrib-jquery" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/91/44/c97faec644d29a5ceddd3020ae2edffa69e7d00054a8c7a6021e82f20335/sphinx_rtd_theme-3.0.2.tar.gz", hash = "sha256:b7457bc25dda723b20b086a670b9953c859eab60a2a03ee8eb2bb23e176e5f85", size = 7620463, upload-time = "2024-11-13T11:06:04.545Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/85/77/46e3bac77b82b4df5bb5b61f2de98637724f246b4966cfc34bc5895d852a/sphinx_rtd_theme-3.0.2-py2.py3-none-any.whl", hash = "sha256:422ccc750c3a3a311de4ae327e82affdaf59eb695ba4936538552f3b00f4ee13", size = 7655561, upload-time = "2024-11-13T11:06:02.094Z" }, +] + [[package]] name = "sphinxcontrib-applehelp" version = "2.0.0" @@ -2994,6 +3114,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/0a/7b/18a8c0bcec9182c05a0b3ec2a776bba4ead82750a55ff798e8d406dae604/sphinxcontrib_htmlhelp-2.1.0-py3-none-any.whl", hash = "sha256:166759820b47002d22914d64a075ce08f4c46818e17cfc9470a9786b759b19f8", size = 98705, upload-time = "2024-07-29T01:09:36.407Z" }, ] +[[package]] +name = "sphinxcontrib-jquery" +version = "4.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/de/f3/aa67467e051df70a6330fe7770894b3e4f09436dea6881ae0b4f3d87cad8/sphinxcontrib-jquery-4.1.tar.gz", hash = "sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a", size = 122331, upload-time = "2023-03-14T15:01:01.944Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/76/85/749bd22d1a68db7291c89e2ebca53f4306c3f205853cf31e9de279034c3c/sphinxcontrib_jquery-4.1-py2.py3-none-any.whl", hash = "sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae", size = 121104, upload-time = "2023-03-14T15:01:00.356Z" }, +] + [[package]] name = "sphinxcontrib-jsmath" version = "1.0.1" @@ -3003,6 +3136,20 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c2/42/4c8646762ee83602e3fb3fbe774c2fac12f317deb0b5dbeeedd2d3ba4b77/sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178", size = 5071, upload-time = "2019-01-21T16:10:14.333Z" }, ] +[[package]] +name = "sphinxcontrib-mermaid" +version = "1.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyyaml" }, + { name = "sphinx", version = "8.1.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "sphinx", version = "8.2.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/97/69/bf039237ad260073e8c02f820b3e00dc34f3a2de20aff7861e6b19d2f8c5/sphinxcontrib_mermaid-1.0.0.tar.gz", hash = "sha256:2e8ab67d3e1e2816663f9347d026a8dee4a858acdd4ad32dd1c808893db88146", size = 15153, upload-time = "2024-10-12T16:33:03.863Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cd/c8/784b9ac6ea08aa594c1a4becbd0dbe77186785362e31fd633b8c6ae0197a/sphinxcontrib_mermaid-1.0.0-py3-none-any.whl", hash = "sha256:60b72710ea02087f212028feb09711225fbc2e343a10d34822fe787510e1caa3", size = 9597, upload-time = "2024-10-12T16:33:02.303Z" }, +] + [[package]] name = "sphinxcontrib-qthelp" version = "2.0.0" From 8c30d934e6503a26a6dad69c8a512bbe07948b47 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Wed, 22 Oct 2025 09:59:15 +0200 Subject: [PATCH 2/5] pages publish correct permissions --- .github/workflows/code.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/code.yaml b/.github/workflows/code.yaml index 3a4b69b..170ff52 100644 --- a/.github/workflows/code.yaml +++ b/.github/workflows/code.yaml @@ -55,6 +55,10 @@ jobs: uv run pytest tests/ -v publish-pages: + permissions: + contents: read + pages: write + id-token: write runs-on: ubuntu-latest #if: ${{startsWith(github.ref, 'refs/tags/')}} # only publish to PyPI on tag pushes From ed2b5cbe19e457c143def163a4946c35008e20b6 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Wed, 22 Oct 2025 10:08:56 +0200 Subject: [PATCH 3/5] pages publish split into two jobs --- .github/workflows/code.yaml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code.yaml b/.github/workflows/code.yaml index 170ff52..ec0498c 100644 --- a/.github/workflows/code.yaml +++ b/.github/workflows/code.yaml @@ -54,10 +54,9 @@ jobs: run: | uv run pytest tests/ -v - publish-pages: + build-pages: permissions: - contents: read - pages: write + contents: write id-token: write runs-on: ubuntu-latest #if: ${{startsWith(github.ref, 'refs/tags/')}} # only publish to PyPI on tag pushes @@ -89,11 +88,33 @@ jobs: shell: bash -l {0} run: uv run make -C docs/ html + - name: Upload + uses: actions/upload-pages-artifact@v3 + with: + path: ./docs/build/html + - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 + # Deployment job + deploy-pages: + permissions: + contents: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build-pages + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + + build: name: Build distribution 📦 runs-on: ubuntu-latest From 9699446cf67b520a8e4a19701f006537ea2a7d52 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Wed, 22 Oct 2025 10:16:23 +0200 Subject: [PATCH 4/5] cicd fix: removed uneccecary deploy step --- .github/workflows/code.yaml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/code.yaml b/.github/workflows/code.yaml index ec0498c..d3844e9 100644 --- a/.github/workflows/code.yaml +++ b/.github/workflows/code.yaml @@ -56,10 +56,11 @@ jobs: build-pages: permissions: - contents: write + contents: read + pages: write id-token: write runs-on: ubuntu-latest - #if: ${{startsWith(github.ref, 'refs/tags/')}} # only publish to PyPI on tag pushes + #if: ${{startsWith(github.ref, 'refs/tags/')}} # only publish pages on tag pushes strategy: matrix: @@ -93,11 +94,6 @@ jobs: with: path: ./docs/build/html - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 - - # Deployment job deploy-pages: permissions: From fea0174323b94f6568410abb0ee48daac6bf1ba3 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Wed, 22 Oct 2025 10:24:26 +0200 Subject: [PATCH 5/5] only deploy pages on master branch updates --- .github/workflows/code.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code.yaml b/.github/workflows/code.yaml index d3844e9..43b0baf 100644 --- a/.github/workflows/code.yaml +++ b/.github/workflows/code.yaml @@ -55,12 +55,13 @@ jobs: uv run pytest tests/ -v build-pages: + if: github.ref == 'refs/heads/master' permissions: contents: read pages: write id-token: write runs-on: ubuntu-latest - #if: ${{startsWith(github.ref, 'refs/tags/')}} # only publish pages on tag pushes + strategy: matrix: @@ -96,6 +97,7 @@ jobs: # Deployment job deploy-pages: + if: github.ref == 'refs/heads/master' permissions: contents: read pages: write