Skip to content

Commit 69ba6f9

Browse files
mkumar73Copilot
andcommitted
ci: add dedicated docs workflow, fix RTD build config
Co-authored-by: Copilot <copilot@github.com>
1 parent ffff437 commit 69ba6f9

4 files changed

Lines changed: 92 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: CI
22

33
on:
44
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
58
pull_request:
69
branches:
710
- main

.github/workflows/docs.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Docs
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
# Only run on PRs that touch docs-related files to keep checks fast.
7+
paths:
8+
- "docs/**"
9+
- "README.md"
10+
- "pyproject.toml"
11+
- "deeptab/**"
12+
push:
13+
# No paths filter here: tag pushes must always build docs regardless of
14+
# which files changed in the tagged commit. Paths filters in GitHub Actions
15+
# apply to both branches and tags under the same push: block, so a tag
16+
# like v1.7.0 would be silently skipped if docs files weren't in that commit.
17+
branches:
18+
- main
19+
tags:
20+
- "v*"
21+
22+
concurrency:
23+
group: docs-${{ github.head_ref || github.ref }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
build-docs:
28+
name: Build docs (Sphinx)
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- name: Install system dependencies
35+
run: sudo apt-get update && sudo apt-get install -y pandoc
36+
37+
- name: Install Poetry
38+
uses: snok/install-poetry@v1
39+
40+
- name: Set up Python
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: "3.10"
44+
cache: "poetry"
45+
46+
- name: Install package
47+
run: poetry install --only main
48+
49+
- name: Install docs dependencies
50+
run: pip install -r docs/requirements_docs.txt
51+
52+
- name: Build Sphinx docs
53+
run: poetry run sphinx-build -b html docs/ docs/_build/html -W --keep-going
54+
55+
# ── Triggered on push to main ──────────────────────────────────────────
56+
# RTD listens to its own webhook and publishes "latest" automatically.
57+
# The step below is informational; actual publishing is done by RTD.
58+
- name: Notify latest/dev docs will be published
59+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
60+
run: echo "Docs build succeeded. RTD will publish the 'latest' version."
61+
62+
# ── Triggered on a release tag ─────────────────────────────────────────
63+
# RTD listens to tag pushes and publishes a versioned snapshot automatically
64+
# when "Build tags" is enabled in the RTD project settings.
65+
- name: Notify stable/versioned docs will be published
66+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
67+
run: |
68+
TAG="${GITHUB_REF_NAME}"
69+
echo "Docs build succeeded for tag ${TAG}. RTD will publish the '${TAG}' versioned docs."

pyproject.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,23 @@ commitizen = "^3.29.1"
3939
twine = "^6.2.0"
4040
pyright = "^1.1.409"
4141

42+
[tool.poetry.group.docs.dependencies]
43+
setuptools = "*"
44+
sphinx = "6.2.1"
45+
sphinx-autodoc-typehints = "1.23.0"
46+
numpydoc = "1.7.0"
47+
nbsphinx = "0.9.4"
48+
ipython = "*"
49+
myst-parser = "3.0.1"
50+
m2r2 = "0.3.3.post2"
51+
sphinx-copybutton = "0.5.2"
52+
sphinx-togglebutton = "0.3.2"
53+
sphinx-book-theme = "1.1.2"
54+
sphinx-rtd-theme = "2.0.0"
55+
readthedocs-sphinx-ext = "2.2.5"
56+
lxml-html-clean = "0.4.0"
57+
pydata-sphinx-theme = "0.15.2"
58+
4259

4360
[tool.poetry.urls]
4461
homepage = "https://github.com/OpenTabular/deeptab"

readthedocs.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@ formats:
2929
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
3030
python:
3131
install:
32+
- method: pip
33+
path: .
34+
extra_requirements: []
3235
- requirements: docs/requirements_docs.txt

0 commit comments

Comments
 (0)