-
Notifications
You must be signed in to change notification settings - Fork 62
38 lines (36 loc) · 1.19 KB
/
validate-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Validate docs
# Only run workflow if the docs are changing.
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore
on:
pull_request:
paths:
- 'mkdocs.yml'
- 'docs/**'
push:
branches:
- main
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # all history for all branches and tags
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Setup MkDocs
run: .github/scripts/setup-docs-dependencies.sh
- name: Build docs
# https://www.mkdocs.org/user-guide/cli/#mkdocs-build
# --strict cause MkDocs to abort the build on any warnings.
# For example, broken internal links. More about validation
# here: https://www.mkdocs.org/user-guide/configuration/#validation.
run: mkdocs build --strict