CI/CD Pipeline
Relevant source files
The following files were used as context for generating this wiki page:
The CI/CD pipeline in FusionOps is designed to automate the build, validation, and deployment of landing pages and backend infrastructure. It leverages GitHub Actions for automated site deployments and custom Node.js scripts for full-stack infrastructure orchestration across Cloudflare Workers, Pages, and D1 databases.
The system supports a multi-target deployment architecture, allowing landing pages to be published to Cloudflare Pages, Netlify, or Vercel based on configurations defined in site-specific manifests. This automation ensures that tracking scripts, color schemes, and security headers are consistently injected during the build process before reaching production environments.
Sources: CLAUDE.md, INFRASTRUCTURE_SETUP.md, files/deploy-sites.yml:1-15
Pipeline Architecture and Orchestration
The pipeline is structured into distinct functional areas: infrastructure setup, automated site deployment via GitHub Actions, and manual deployment utilities. The primary automated workflow is triggered by pushes to the main branch or specific release/** paths.
Automated Site Deployment Flow
The Deploy Sites workflow automates the transition from raw site files to live URLs. It follows a structured sequence of detection, validation, and multi-target deployment.
The workflow detects changed folders under sites/ and uses ajv-cli to validate the deploy-manifest.json against a predefined schema before proceeding with any deployment operations.
Sources: files/deploy-sites.yml:1-120
Infrastructure Management
Infrastructure deployment is handled by scripts that prepare the Cloudflare environment. The process includes creating D1 databases, executing SQL migrations, and deploying functional workers (api-worker, pixel-worker, etc.).
| Component | Tool / Script | Purpose |
|---|---|---|
| D1 Databases | wrangler d1 | State storage for campaigns, tracking, and leads. |
| Workers | wrangler deploy | Backend logic for API, Pixel, and Callbacks. |
| Migrations | scripts/setup-infrastructure.js | Automated execution of .sql files to sync schemas. |
| Configuration | updateWranglerToml | Dynamic ID replacement in wrangler.toml files. |
Sources: scripts/setup-infrastructure.js:20-45, INFRASTRUCTURE_SETUP.md:75-100
Deployment Targets and Providers
The system dynamically resolves deployment targets from a deploy-manifest.json file located in each site's directory. This allows different landing pages in the same repository to utilize different hosting providers.
Provider Resolution Logic
The pipeline parses the targets array in the manifest to determine which deployment steps to execute. It also supports fallback mechanisms using repository variables (vars) or secrets.
Key Provider Configurations
- Cloudflare Pages: Uses
wrangler pages deploy. RequiresCLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_ID. - Netlify: Uses
netlify-cli. RequiresNETLIFY_AUTH_TOKENandsiteIdfrom manifest or fallbacks. - Vercel: Uses
vercelCLI. RequiresVERCEL_TOKEN.
Sources: files/deploy-sites.yml:150-200
Automated Verification and Callbacks
A critical feature of the pipeline is the status callback. Upon completion of a deployment (success or failure), the pipeline sends a PATCH request to the FusionOps API Worker to update the deployment record.
Status Callback Metadata
The callback includes the following data points to ensure the dashboard remains synced with the actual state of the infrastructure:
- status:
successorfailed. - url: The production URL generated by the provider (e.g.,
.pages.dev,.netlify.app). - errorMessage: Specific failure details if the workflow failed.
- config: Metadata including the
runUrlfor direct link to GitHub Action logs.
Sources: files/deploy-sites.yml:215-255
Build-Time Transformations
Before deployment, templates undergo a build-variant approach where hardcoded values are replaced and tracking scripts are injected.
Injection Pipeline
The pipeline handles several automated concerns:
- First-party pixel: Injected via
inject-tracking.mjs. - Google Ads gtag: Automated placement of conversion scripts.
- Color Schemes: Injection of CSS variables (e.g.,
--primary) based on site configurations. - Anti-fingerprint transforms: Applied by
TemplateBuilder.jsto vary HTML/CSS structures.
Sources: LionFunds/lovable-lp-template-prompt.md:210-230, CLAUDE.md:145-160
Infrastructure Setup Commands
For new environments or updates to shared resources, the following command sequence is utilized:
# Full infrastructure setup (D1, Migrations, Workers)
node scripts/setup-infrastructure.js
# Full build and deploy (Web app + Workers)
node scripts/deploy-all.js
# Targeted deployment
node scripts/deploy-all.js --workers-only
node scripts/deploy-all.js --web-only
Sources: scripts/setup-infrastructure.js:340-360, scripts/deploy-all.js:200-220
The FusionOps CI/CD pipeline provides a robust framework for managing high-volume landing page deployments with integrated tracking and infrastructure consistency. By combining GitHub Actions for site publishing and specialized Node.js scripts for Cloudflare resource management, the system ensures that every deployment is validated and reported back to the central control plane.