docs: only trigger doc pages rebuild when modifying the doc folder

This commit is contained in:
alfrix 2024-03-18 08:41:56 -03:00
parent 48b374c73e
commit daed9a098b
2 changed files with 18 additions and 5 deletions

View File

@ -1,9 +1,9 @@
name: docs name: docs
on: on:
push: push:
branches: branches: [master, main]
- master paths:
- main - 'docs/**'
permissions: permissions:
contents: write contents: write
jobs: jobs:

View File

@ -7,6 +7,19 @@ build:
os: ubuntu-lts-latest os: ubuntu-lts-latest
tools: tools:
python: latest 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: mkdocs:
configuration: mkdocs.yml configuration: mkdocs.yml
# Optionally declare the Python requirements required to build your docs # Optionally declare the Python requirements required to build your docs