Skip to content
Merged
Prev Previous commit
Next Next commit
The keys build.jobs and build.commands can't be used together
  • Loading branch information
hugovk committed May 2, 2023
commit e610f227f36d03fc0fcf54db51fc36f2e08d9a4d
28 changes: 13 additions & 15 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,20 @@ build:
tools:
python: "3"

jobs:
post_checkout:
# https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition
#
# Cancel building pull requests when there aren't changes in the Doc directory.
#
# If there are no changes (git diff exits with 0) we force the command to return with 183.
# This is a special exit code on Read the Docs that will cancel the build immediately.
- |
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- Doc/ .readthedocs.yml;
then
echo "No changes to Doc/ - exiting the build.";
exit 183;
fi

commands:
# https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition
#
# Cancel building pull requests when there aren't changes in the Doc directory.
#
# If there are no changes (git diff exits with 0) we force the command to return with 183.
# This is a special exit code on Read the Docs that will cancel the build immediately.
- |
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- Doc/ .readthedocs.yml;
then
Comment thread
hugovk marked this conversation as resolved.
Outdated
echo "No changes to Doc/ - exiting the build.";
exit 183;
fi

- make -C Doc venv html
- mkdir _readthedocs
- mv Doc/build/html _readthedocs/html