feat(ci): make preview deployment conditional on CI test#8
Open
Aswinmcw wants to merge 14 commits into
Open
Conversation
Aswinmcw
commented
Jun 28, 2025
Member
- Change trigger from PR events to workflow_run after CI completion
- Remove redundant test execution in preview workflow
- Add proper PR information extraction for workflow_run events
- Update all references to use dynamic PR info
- Maintain cleanup functionality for PR closure
- Improve deployment messaging to indicate CI success prerequisite
- Change trigger from PR events to workflow_run after CI completion - Remove redundant test execution in preview workflow - Add proper PR information extraction for workflow_run events - Update all references to use dynamic PR info - Maintain cleanup functionality for PR closure - Improve deployment messaging to indicate CI success prerequisite
The branches filter in workflow_run prevents triggering for PR branches. workflow_run should trigger for any completed CI workflow regardless of branch.
- Replace workflow_run with pull_request trigger - Add CI status polling to wait for completion before deployment - Check for 'all-checks-complete' job success status - Timeout after 30 minutes if CI doesn't complete - More reliable than workflow_run trigger limitations
🚀 Preview Deployment Ready!✅ CI Tests Passed - Your PR has been successfully deployed after passing all integration tests! 🌐 Preview LinkFrontend + API: https://pr-review-checker-ip2zj5510-aswincoders-projects.vercel.app 📊 Deployment Details
🧪 Test Your ChangesYou can now test the PR approval finder with your changes:
📝 Notes
Deployed by GitHub Actions after CI success • View Workflow |
- Replace polling with check_suite completion event - Trigger preview deployment instantly when all checks pass - No waiting or timeouts - pure event-driven approach - More efficient and responsive than polling - Clean separation of CI completion and deployment triggers
- Use workflow_run event with explicit success check - Improve PR detection using GitHub search API with commit SHA - Add better logging for debugging trigger issues - Simplify condition logic for more reliable triggering
- Replace problematic workflow_run with repository_dispatch event - Add trigger step to CI workflow when all checks pass - Pass PR information via client payload - More reliable than workflow_run with better debugging - Ensures preview only deploys after successful CI completion
- Fix permissions issue with repository_dispatch - Use workflow_dispatch with manual inputs instead - Trigger preview workflow using GitHub CLI - More reliable and doesn't require special permissions - Maintains the same CI-triggered behavior
- Add checkout step to all-checks-complete job for PR events - Required for gh CLI to work in git repository context - Fixes 'fatal: not a git repository' error
- Replace workflow_dispatch trigger with status event - CI creates 'ci/preview-ready' status on success - Preview workflow triggers on this specific status - Avoids permissions issues with workflow dispatch - More reliable event-driven approach
- Add pull_request trigger as backup to status events - Enhanced status API logging for debugging - Check CI status in pull_request events with 60s delay - Multiple trigger paths for better reliability - Fallback mechanism if status events don't work
- Remove delay-based CI status checking - Use workflow_run event for instant triggering when CI completes - Simplify preview workflow logic without polling or delays - Only trigger preview deployment after CI pipeline succeeds - Maintain cleanup functionality for closed PRs
- Add workflow_run trigger with branch filtering for instant deployment - Keep pull_request trigger as fallback with intelligent CI status checking - Add comprehensive debugging and trigger source tracking - Remove artificial delays - use real-time CI status API instead - Support multiple trigger paths for maximum reliability: * workflow_run: instant trigger when CI completes (preferred) * pull_request: fallback with CI verification for reliability * workflow_dispatch: manual triggering still available
- CI workflow now directly triggers preview deployment via workflow_dispatch - Remove dependency on unreliable workflow_run triggers - Use github-script action for robust API calls with proper error handling - Add new 'ci_triggered' source type for tracking - Ensure preview deployment happens immediately after CI success - Maintain all existing fallback mechanisms for reliability
- Replace complex workflow_dispatch with simple status events - CI creates commit status 'ci/preview-ready' when all tests pass - Preview workflow triggers on status events (instant and reliable) - Remove all permission-dependent triggering mechanisms - Simplify logic - status event = CI passed = deploy immediately - This approach works with default GITHUB_TOKEN permissions
Aswin-coder
previously approved these changes
Aug 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.