docs: only trigger doc pages rebuild when modifying the doc folder
This commit is contained in:
parent
48b374c73e
commit
daed9a098b
10
.github/workflows/docs.yml
vendored
10
.github/workflows/docs.yml
vendored
@ -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:
|
||||||
@ -18,12 +18,12 @@ jobs:
|
|||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.x
|
python-version: 3.x
|
||||||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
key: mkdocs-material-${{ env.cache_id }}
|
key: mkdocs-material-${{ env.cache_id }}
|
||||||
path: .cache
|
path: .cache
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
mkdocs-material-
|
mkdocs-material-
|
||||||
- run: pip install mkdocs-material
|
- run: pip install mkdocs-material
|
||||||
- run: mkdocs gh-deploy --force
|
- run: mkdocs gh-deploy --force
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user