Skip to content

Commit 26c345a

Browse files
committed
[ci] Also test building docs in PRs
1 parent 9a7c053 commit 26c345a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
name: Build and deploy docs
1+
name: Build docs
22

33
on:
44
push:
55
branches:
66
- main
77
- main-**
8+
pull_request:
89

910
jobs:
1011
build-upload-docs:
@@ -13,12 +14,6 @@ jobs:
1314
- name: Check out repository
1415
uses: actions/checkout@v4
1516

16-
- name: Configure Git
17-
run: |
18-
git config --global user.email "[email protected]"
19-
git config --global user.name "modm update bot"
20-
21-
2217
- name: Setup Python 3.12
2318
uses: actions/setup-python@v4
2419
with:
@@ -28,19 +23,26 @@ jobs:
2823
run: |
2924
pip3 install -r tools/requirements.txt ".[docs]"
3025
26+
3127
- name: Clone modm-ext/data.modm.io repository
28+
if: startsWith(github.ref, 'refs/heads/main')
3229
uses: actions/checkout@v4
3330
with:
3431
repository: modm-ext/data.modm.io
3532
ssh-key: ${{secrets.SSH_KEY_DATA_MODM_IO}}
3633
path: docs/data.modm.io
3734

35+
3836
- name: Build Homepage
3937
run: |
4038
make build-homepage
4139
40+
4241
- name: Push New Docs to Github
42+
if: startsWith(github.ref, 'refs/heads/main')
4343
run: |
44+
git config --global user.email "[email protected]"
45+
git config --global user.name "modm update bot"
4446
cd docs/data.modm.io
4547
git add -A
4648
git diff-index --quiet HEAD || git commit -m "Update"

0 commit comments

Comments
 (0)