You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contributing/documentation/admins.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,6 +153,35 @@ You can do this through your {file}`.readthedocs.yaml` file.
153
153
Read the Docs covers a few scenarios in its documentation, [Cancel build based on a condition](https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition).
154
154
155
155
156
+
#### Build only on changes
157
+
158
+
When there are no changes to documentation, it is not necessary to build it.
159
+
You can save time and energy by programmatically building documentation only when it changes.
160
+
161
+
In your {file}`.readthedocs.yaml` file, you could use the following example.
162
+
163
+
```yaml
164
+
version: 2
165
+
build:
166
+
os: "ubuntu-22.04"
167
+
tools:
168
+
python: "3.12"
169
+
jobs:
170
+
post_checkout:
171
+
# Cancel building pull requests when there aren't changes in the docs directory or YAML file.
172
+
# You can add any other files or directories that you'd like here as well,
173
+
# like your docs requirements file, or other files that will change your docs build.
174
+
#
175
+
# If there are no changes (git diff exits with 0) we force the command to return with 183.
176
+
# This is a special exit code on Read the Docs that will cancel the build immediately.
0 commit comments