CI Integration

Send deploy events from your CI/CD pipeline so Cloudlink can link cost changes to specific releases.

How it works

  1. Your CI pipeline deploys code
  2. After the deploy step, it sends a POST request to Cloudlink's /deploys endpoint
  3. Cloudlink records the deploy and, after 2-3 hours, compares post-deploy costs against the 7-day baseline
  4. If costs spike >10%, a regression is created and alerts fire (Slack, email, webhooks)

GitHub Actions

Add this step after your deploy step in your workflow:

- name: Notify Cloudlink
  if: success()
  run: |
    curl -s -X POST ${{ secrets.CLOUDLINK_API_URL }}/deploys \
      -H "Authorization: Bearer ${{ secrets.CLOUDLINK_API_KEY }}" \
      -H "Content-Type: application/json" \
      -d '{
        "service": "my-service",
        "version": "${{ github.sha }}",
        "environment": "production",
        "source": "github-actions"
      }'

Required secrets

SecretValue
CLOUDLINK_API_URLYour Cloudlink API URL (e.g. https://cloudlink-agents-production.up.railway.app)
CLOUDLINK_API_KEYYour API key from the Cloudlink dashboard

GitLab CI

notify_cloudlink:
  stage: post-deploy
  script:
    - |
      curl -s -X POST $CLOUDLINK_API_URL/deploys \
        -H "Authorization: Bearer $CLOUDLINK_API_KEY" \
        -H "Content-Type: application/json" \
        -d "{
          \"service\": \"my-service\",
          \"version\": \"$CI_COMMIT_SHA\",
          \"environment\": \"production\",
          \"source\": \"gitlab-ci\"
        }"
  only:
    - main

Generic (any CI)

Any system that can make HTTP requests can send deploy events:

curl -X POST https://your-api-url/deploys \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "service": "service-name",
    "version": "v1.2.3",
    "environment": "production"
  }'

Deploy event fields

FieldRequiredDescription
serviceYesAWS service name (must match Cost Explorer service name, e.g. "Amazon EC2")
versionNoGit SHA, tag, or version number
environmentNoDeploy target (default: "production")
sourceNoCI system identifier
metadataNoArbitrary JSON object for your own tracking

Verifying integration

After pushing a deploy event, check Dashboard → Deploys to confirm it appeared. You can also click Run detection to manually trigger regression analysis (normally runs automatically every 30 minutes).