Skip to content

Commit d68a965

Browse files
committed
ci: run build on PRs, deploy to Pages on main only
Add pull_request trigger so the build job runs on every PR against main, catching docfx regressions before merge. Upload and deploy steps are guarded by `if: github.ref == 'refs/heads/main'` so GitHub Pages deployment only happens on push to main. https://claude.ai/code/session_01HDAawqjLMudEktivP5ifXw
1 parent 283d8b8 commit d68a965

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/documentation.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- main
7+
pull_request:
8+
branches:
9+
- main
710

811
permissions:
912
contents: read
@@ -29,14 +32,16 @@ jobs:
2932
- name: Build
3033
run: docfx Documentation/docfx.json
3134

32-
# Upload the generated documentation
35+
# Upload the generated documentation (only on main for deployment)
3336
- name: Upload site artifact
37+
if: github.ref == 'refs/heads/main'
3438
uses: actions/upload-pages-artifact@v3
3539
with:
3640
path: _site # Must equal the 'build.dest' value in docfx.json
3741

3842
# Deploy the generated documentation to GitHub Pages
3943
deploy:
44+
if: github.ref == 'refs/heads/main'
4045
needs: build
4146
runs-on: ubuntu-latest
4247
environment:

0 commit comments

Comments
 (0)