docs: only trigger doc pages rebuild when modifying the doc folder
This commit is contained in:
parent
48b374c73e
commit
daed9a098b
6
.github/workflows/docs.yml
vendored
6
.github/workflows/docs.yml
vendored
@ -1,9 +1,9 @@
|
||||
name: docs
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
branches: [master, main]
|
||||
paths:
|
||||
- 'docs/**'
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
|
@ -7,6 +7,19 @@ build:
|
||||
os: ubuntu-lts-latest
|
||||
tools:
|
||||
python: latest
|
||||
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 -- docs/ .readthedocs.yaml;
|
||||
then
|
||||
exit 183;
|
||||
fi
|
||||
mkdocs:
|
||||
configuration: mkdocs.yml
|
||||
# Optionally declare the Python requirements required to build your docs
|
||||
|
Loading…
x
Reference in New Issue
Block a user