You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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] <[email protected]>
Co-authored-by: Madelyn Olson <[email protected]>
0 commit comments