supaguardsupaguardDocs
Guides

CI/CD Integration Guide

Integrate supaguard into your deployment pipeline. Learn how to trigger synthetic checks after every deploy to ensure zero regressions in production.

Modern engineering teams don't just "deploy and pray." They verify every release. By integrating supaguard into your CI/CD pipeline, you can automatically trigger synthetic checks the moment your code goes live.

Why Integrate with CI/CD?

  • Immediate Feedback: Know within seconds if a new deploy broke a critical user flow.
  • Automated Rollbacks: Use supaguard's API to trigger a rollback if production checks fail.
  • Environment Parity: Run the same Playwright scripts against staging and production.

Triggering Checks via API

The most common way to integrate is using our checks/{id}/execute endpoint.

GitHub Actions Example

Use this snippet in your .github/workflows/deploy.yml to verify your app after a successful deployment.

name: Deploy & Verify
on: [push]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to Vercel
        id: deploy
        run: # your deploy command
      
      - name: Trigger supaguard Verification
        run: |
          curl -X POST "https://app.supaguard.com/api/checks/YOUR_CHECK_ID/execute" 
          -H "Authorization: Bearer ${{ secrets.SUPAGUARD_API_KEY }}" 
          -H "Content-Type: application/json"

GitLab CI Example

verify-deploy:
  stage: post-deploy
  script:
    - curl -X POST "https://app.supaguard.com/api/checks/$SUPAGUARD_CHECK_ID/execute" 
      -H "Authorization: Bearer $SUPAGUARD_API_KEY"
  only:
    - main

Using Webhooks for Deployment Tracking

You can also configure your CI/CD tool to send a webhook to supaguard. This allows you to:

  1. Mark Deployment Events: See exactly when a deploy happened on your check result timeline.
  2. Correlate Failures: Identify if a specific failure started immediately after a version update.

Best Practices

  • Wait for Cold Starts: If your app has cold starts (e.g., Lambda/Serverless), add a short 5-10 second delay before triggering the check.
  • Use Staging Environments: Trigger checks against your staging URL before merging to main to catch bugs even earlier.
  • Fail the Build: For critical checks, configure your CI to wait for the supaguard result and fail the build if the check returns a CRITICAL status.

[!IMPORTANT] Ensure your SUPAGUARD_API_KEY is stored as a "Secret" or "Protected Variable" in your CI/CD settings. Never commit it to version control.

Next Steps

On this page