CI/CD

CI/CD Overview

Run Frontguard visual regression tests in continuous integration pipelines.

CI/CD Overview

Frontguard is designed to run in CI/CD pipelines. It auto-detects preview deployment URLs, posts PR comments with visual diffs, and returns proper exit codes for pass/fail gating.

Supported CI Providers

Frontguard works in any CI environment that supports Node.js. First-class support includes:

ProviderAuto-detect Preview URLPR Comments
GitHub Actions
Vercel✅ (via VERCEL_URL)Via GitHub
Netlify✅ (via DEPLOY_PRIME_URL)Via GitHub
Cloudflare Pages✅ (via CF_PAGES_URL)Via GitHub
Railway✅ (via RAILWAY_STATIC_URL)Via GitHub
Render✅ (via RENDER_EXTERNAL_URL)Via GitHub
OthersManual URLJSON output

Preview URL Auto-Detection

Frontguard automatically detects preview deployment URLs from environment variables set by popular hosting providers. The detection order is:

  1. Explicit --url flag (always wins)
  2. VERCEL_URL / VERCEL_PREVIEW_URL
  3. DEPLOY_PRIME_URL / DEPLOY_URL (Netlify)
  4. CF_PAGES_URL (Cloudflare Pages)
  5. RAILWAY_STATIC_URL (Railway)
  6. RENDER_EXTERNAL_URL (Render)

If no URL is detected, Frontguard warns you and exits. Always set the url input as a fallback.

Exit Codes

Frontguard uses standard exit codes for CI gating:

Exit CodeMeaningCI Result
0All tests passed✅ Green
1Regressions detected❌ Fail
2Pipeline errors❌ Fail

PR Comments

When GITHUB_TOKEN is set, Frontguard posts a PR comment with:

  • Summary table of all tested routes
  • Visual diff images (baseline vs current vs diff overlay)
  • AI analysis with severity and explanation
  • Suggested fixes when available

Reports

Every run generates artifacts you can upload:

  • HTML report — Interactive side-by-side comparison
  • JSON report — Machine-readable results
  • Diff images — PNG overlays highlighting changes

Next Steps

On this page