Skip to content

Commit

Permalink
Cancel docs build if no changes
Browse files Browse the repository at this point in the history
  • Loading branch information
maxschulz-COL committed Nov 2, 2023
1 parent c2419ab commit 5cfb854
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions vizro-ai/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,16 @@ build:
- cd vizro-ai/ && hatch run docs:mkdocs build
- mkdir --parents $READTHEDOCS_OUTPUT
- mv vizro-ai/site/ $READTHEDOCS_OUTPUT/html
jobs:
post_checkout:
# Cancel building pull requests when there aren't changed in the docs directory or YAML file.
# You can add any other files or directories that you'd like here as well,
# like your docs requirements file, or other files that will change your docs build.
#
# 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 -- vizro-ai/docs/ vizro-ai/.readthedocs.yaml;
then
exit 183;
fi
13 changes: 13 additions & 0 deletions vizro-core/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,16 @@ build:
- cd vizro-core/ && hatch run docs:mkdocs build
- mkdir --parents $READTHEDOCS_OUTPUT
- mv vizro-core/site/ $READTHEDOCS_OUTPUT/html
jobs:
post_checkout:
# Cancel building pull requests when there aren't changed in the docs directory or YAML file.
# You can add any other files or directories that you'd like here as well,
# like your docs requirements file, or other files that will change your docs build.
#
# 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 -- vizro-core/docs/ vizro-core/.readthedocs.yaml;
then
exit 183;
fi

0 comments on commit 5cfb854

Please sign in to comment.