Commit 9f230f0
Add automatic PR validation workflow integrated with Zola deployment (#325)
This PR adds automatic build validation for pull requests to prevent
website deployment failures by integrating PR validation directly into
the existing Zola deployment workflow.
## Problem
Currently, PRs are not validated to ensure the website will render
correctly, which can result in deployment failures when changes are
merged to the main branch.
## Solution
Enhanced the existing `zola-deploy.yml` workflow to handle both PR
validation and production deployment:
- **Triggers on pull requests**: Added `pull_request` trigger targeting
the main branch for validation
- **Conditional deployment**: Uses `if: github.event_name !=
'pull_request'` to skip deployment steps for PRs
- **Smart checkout**: Automatically checks out PR branch for pull
requests or main branch for deployments
- **Unified build logic**: Both PR validation and deployment use
identical build processes
## Benefits
- **Prevents deployment failures**: Catches build issues before they
reach production
- **Immediate feedback**: Contributors get build validation results
directly in their PRs
- **Consistent validation**: Uses identical build logic as production
deployment
- **Reduced maintenance**: Single workflow file eliminates code
duplication
- **Minimal implementation**: Enhanced existing workflow instead of
adding separate files
The workflow validates:
- TOML configuration syntax errors
- Missing or broken content files
- Template rendering problems
- Sass compilation issues
- Any other build-time errors
This ensures that only PRs with valid, buildable changes can be merged,
significantly reducing the risk of deployment failures while maintaining
a clean, consolidated workflow structure.
Fixes #324.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>1 parent 7394309 commit 9f230f0
1 file changed
+21
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | | - | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
40 | | - | |
41 | | - | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
46 | | - | |
47 | | - | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
52 | | - | |
53 | | - | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | | - | |
59 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
| 74 | + | |
67 | 75 | | |
| 76 | + | |
68 | 77 | | |
69 | 78 | | |
70 | 79 | | |
| 80 | + | |
71 | 81 | | |
| 82 | + | |
72 | 83 | | |
73 | 84 | | |
74 | 85 | | |
| |||
0 commit comments