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
feat(ci): implement automated CI/CD deployment pipelines via GitHub webhooks (#64)
**Description:**
This PR introduces a fully automated CI/CD pipeline natively into Domain
Forge, allowing subdomains tied to GitHub repositories to be seamlessly
torn down and rebuilt whenever new code is pushed.
This completes the closed-loop redeployment workflow, removing the need
for manual teardowns when deploying updates.
**Key Changes:**
- **Automated Webhook Registration**: Added logic to effortlessly
auto-register a push webhook on the user's GitHub repository via OAuth
whenever the "Enable CI/CD" toggle is active on the deployment
dashboard.
- **Webhook Listener**: Registered a `/webhook/github` endpoint that
securely parses incoming push payloads, filters for `main`/`master`
branches, and triggers the deployment script cluster.
- **Robust URL Matching Strategy**: Fixed critical bugs where webhook
matches failed due to `.git` extensions and trailing slashes. All
repository URLs are now dynamically parsed and stripped natively via
regex in MongoDB searches.
- **Crash Prevention**: Shielded the Deno execution engine from fatal
TypeErrors when compiling configurations for redeployments by ensuring
undefined GUI variables (`.env`, empty configurations) safely fallback
to empty strings.
- **Conflict Immunization**: Hardened `container.sh` to forcefully
eliminate ghost containers. This prevents immediate `502 Bad Gateway`
errors caused by rapid-fire API requests or Docker port collision
edge-cases.
**Testing:**
- Verified frontend dynamically syncs the `enable_ci` state backwards to
the database.
- Confirmed GitHub accurately delivers push payloads resulting in fully
autonomous container updates.
- Tested and handled aggressive UI requests to ensure zero Docker race
conditions.
0 commit comments