Skip to content

Commit fb32348

Browse files
committed
build docs on PRs where docs change
1 parent 627eb2b commit fb32348

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/deploy_mkdocs.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@ on:
55
branches:
66
- main
77
paths:
8-
# Only rebuild website when docs have changed
8+
- 'README.md'
9+
- 'CHANGELOG.md'
10+
- 'CONTRIBUTING.md'
11+
- 'docs/**'
12+
pull_request:
13+
paths:
914
- 'README.md'
1015
- 'CHANGELOG.md'
1116
- 'CONTRIBUTING.md'
1217
- 'docs/**'
1318

1419
jobs:
15-
build:
16-
name: Deploy docs
20+
docs:
21+
name: ${{ github.event_name == 'push' && 'Deploy docs' || 'Build docs' }}
1722
runs-on: ubuntu-latest
1823
steps:
1924
- uses: actions/checkout@v4
@@ -28,5 +33,10 @@ jobs:
2833
python -m pip install --upgrade pip
2934
python -m pip install mkdocs mkdocs-material mkdocs-jupyter pandas seaborn folium
3035
36+
- name: Build docs
37+
if: github.event_name == 'pull_request'
38+
run: mkdocs build -f docs/mkdocs.yml
39+
3140
- name: Deploy docs
41+
if: github.event_name == 'push'
3242
run: mkdocs gh-deploy --force -f docs/mkdocs.yml

0 commit comments

Comments
 (0)