Skip to content

Commit 88bc28b

Browse files
ewdurbinmiketheman
andauthored
skip RTD builds if no relevant changes occur (#17544)
* skip RTD builds if no relevant changes occur ref: https://docs.readthedocs.com/platform/stable/build-customization.html#cancel-build-based-on-a-condition * add docs requirements files * Update bin/rtd-docs Co-authored-by: Mike Fiedler <[email protected]> * Apply suggestions from code review --------- Co-authored-by: Mike Fiedler <[email protected]>
1 parent ad63ce8 commit 88bc28b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

bin/rtd-docs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,32 @@ set -e
55
set -x
66

77
if [ "${READTHEDOCS_PROJECT}" = "warehouse" ]; then
8+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/dev requirements/docs-dev.txt .readthedocs.yaml; then
9+
echo "Nothing relevant changed, skipping build..."
10+
exit 183;
11+
fi
812
pip install -r requirements/docs-dev.txt
913
asdf reshim
1014
make -C docs/dev/ html
1115
mkdir _readthedocs && mv docs/dev/_build/html _readthedocs/html
1216
fi
1317

1418
if [ "${READTHEDOCS_PROJECT}" = "docspypiorg" ]; then
19+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/user requirements/docs-user.txt .readthedocs.yaml docs/mkdocs-user-docs.yml; then
20+
echo "Nothing relevant changed, skipping build..."
21+
exit 183;
22+
fi
1523
pip install -r requirements/docs-user.txt
1624
asdf reshim
1725
mkdocs build -f docs/mkdocs-user-docs.yml
1826
mkdir _readthedocs && mv docs/user-site _readthedocs/html
1927
fi
2028

2129
if [ "${READTHEDOCS_PROJECT}" = "blogpypiorg" ] || [ "${READTHEDOCS_PROJECT}" = "psf-warehouse-private" ]; then
30+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/blog requirements/docs-blog.txt .readthedocs.yaml docs/mkdocs-blog.yml; then
31+
echo "Nothing relevant changed, skipping build..."
32+
exit 183;
33+
fi
2234
pip install -r requirements/docs-blog.txt
2335
asdf reshim
2436
mkdocs build -f docs/mkdocs-blog.yml

0 commit comments

Comments
 (0)