Skip to content

Commit 33a64eb

Browse files
authored
ci: improve GitHub Actions workflow for website builds (#1151)
# What does this PR do? Refine the existing update-readthedocs.yml workflow to enhance automation and reliability. Updates include: - Expanding path triggers to cover all documentation files (docs/**) and build artifacts. - Adding steps to set up Python (3.11), install uv, sync dependencies, and build HTML using make html. - Ensuring the ReadTheDocs build trigger only runs on workflow_dispatch events. These improvements help validate website builds in PRs, preventing issues before merging. Signed-off-by: Sébastien Han <seb@redhat.com> Signed-off-by: Sébastien Han <seb@redhat.com>
1 parent dd43494 commit 33a64eb

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

.github/workflows/update-readthedocs.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,42 @@ on:
1111
branches:
1212
- main
1313
paths:
14-
- 'docs/source/**'
15-
- 'docs/resources/**'
14+
- 'docs/**'
15+
- '.github/workflows/update-readthedocs.yml'
16+
pull_request:
17+
branches:
18+
- main
19+
paths:
20+
- 'docs/**'
1621
- '.github/workflows/update-readthedocs.yml'
1722

1823
jobs:
1924
update-readthedocs:
20-
runs-on: ubuntu-latest
25+
runs-on: ubuntu-latest
2126
env:
2227
TOKEN: ${{ secrets.READTHEDOCS_TOKEN }}
2328
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Set up Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: '3.11'
36+
37+
- name: Install the latest version of uv
38+
uses: astral-sh/setup-uv@v5
39+
40+
- name: Sync with uv
41+
run: uv sync --extra docs
42+
43+
- name: Build HTML
44+
run: |
45+
cd docs
46+
uv run make html
47+
2448
- name: Trigger ReadTheDocs build
49+
if: github.event_name != 'pull_request'
2550
run: |
2651
if [ -z "$TOKEN" ]; then
2752
echo "READTHEDOCS_TOKEN is not set"

0 commit comments

Comments
 (0)