# Railway & GitHub

> Deploy webhooks for automatic regression detection

Rocketgraph analyzes your production telemetry before and after every deploy to catch regressions. Connect your deploy pipeline so analysis runs automatically.

## Railway

### Setup

1. Go to [rocketgraph.app/settings](https://rocketgraph.app/settings) → **Deployment Analysis**
2. Save your preferred time windows (how long to look before/after a deploy)
3. Copy the **webhook URL** shown
4. In your Railway project → **Settings** → **Deploy Webhooks** → paste the URL

### What happens on each deploy

1. Railway sends a webhook to Rocketgraph with the deploy metadata (commit, branch, author, timestamp)
2. Rocketgraph records the deploy and waits for the configured `time_after` window
3. The ML pipeline fetches logs from your connected datasource (Sentry, Loki, etc.) for windows before and after the deploy
4. A deterministic diff is computed: new errors, disappeared patterns, volume changes
5. If you have Slack connected, a summary is posted to your channel

### Viewing results

Go to [rocketgraph.app/sentry](https://rocketgraph.app/sentry) to see your deploy history. Click any deploy to expand the before/after diff. Click **Run RCA** for Claude-powered root cause analysis.

## GitHub Actions

POST to the same webhook URL from your CI/CD pipeline. The simplest approach:

```yaml
# .github/workflows/deploy.yml
- name: Notify Rocketgraph
  if: github.ref == 'refs/heads/main'
  run: |
    curl -X POST "${{ secrets.ROCKETGRAPH_DEPLOY_WEBHOOK }}" \
      -H "Content-Type: application/json" \
      -d '{
        "repo": "${{ github.repository }}",
        "branch": "main",
        "commit": "${{ github.sha }}",
        "pusher": "${{ github.actor }}"
      }'
```

Rocketgraph also supports the native GitHub push webhook format — you can point GitHub's webhook settings directly at the URL.

## Deploy metadata

Each deploy is stored with:

- **Commit hash** — links to the code change
- **Branch** — which branch was deployed
- **Commit message** — what changed
- **Author** — who deployed
- **Timestamp** — when the deploy happened
- **Service name** — which service was deployed (from Railway metadata)

This metadata is used to correlate errors with specific deploys and show "Introduced in commit X" on the Sentry page.
