AlphornAlphorn Docs

Deployment Notifications

Send deployment notifications from Docker Compose, Kubernetes, Vercel, Netlify, and Railway when deploys start, succeed, or fail, routed to the right team.

Deployments affect everyone. Whether it's a new feature going live or a hotfix rolling out, the right people need to know - in real time, not via a status page they might not check.

Docker / Docker Compose

Wrap your deploy script with notifications:

deploy.sh
#!/bin/bash
WEBHOOK="https://app.alphorn.dev/n/V1StGXR8_Z5jdHi6B-myT"
ALPHORN_API_KEY="${ALPHORN_API_KEY:-alp_...}"  # or export it in the environment
SERVICE="my-app"
VERSION=$(git describe --tags --always)

# Notify start
curl -fsS -X POST "$WEBHOOK" \
  -H "Authorization: Bearer $ALPHORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"title\": \"Deploy started: $SERVICE\",
    \"message\": \"Deploying $VERSION to production\",
    \"priority\": 2,
    \"tags\": [\"deploy\", \"started\", \"$SERVICE\"]
  }"

# Deploy
docker compose pull && docker compose up -d
EXIT_CODE=$?

if [ $EXIT_CODE -eq 0 ]; then
  curl -fsS -X POST "$WEBHOOK" \
    -H "Authorization: Bearer $ALPHORN_API_KEY" \
    -H "Content-Type: application/json" \
    -d "{
      \"title\": \"Deploy succeeded: $SERVICE\",
      \"message\": \"$VERSION is live in production\",
      \"priority\": 2,
      \"tags\": [\"deploy\", \"success\", \"$SERVICE\"]
    }"
else
  curl -fsS -X POST "$WEBHOOK" \
    -H "Authorization: Bearer $ALPHORN_API_KEY" \
    -H "Content-Type: application/json" \
    -d "{
      \"title\": \"Deploy FAILED: $SERVICE\",
      \"message\": \"$VERSION failed to deploy (exit $EXIT_CODE)\",
      \"priority\": 5,
      \"tags\": [\"deploy\", \"failure\", \"$SERVICE\"]
    }"
fi

Kubernetes

Send a notification from a Kubernetes Job or post-deploy hook:

post-deploy-job.yaml
apiVersion: batch/v1
kind: Job
metadata:
  name: deploy-notify
spec:
  template:
    spec:
      containers:
        - name: notify
          image: curlimages/curl
          command:
            - curl
            - -fsS
            - -X
            - POST
            - $(ALPHORN_WEBHOOK)
            - -H
            - "Authorization: Bearer $(ALPHORN_API_KEY)"
            - -H
            - "Content-Type: application/json"
            - -d
            - '{"title":"Deployed to k8s","message":"$(APP_VERSION) rolled out","priority":2,"tags":["deploy","k8s"]}'
          env:
            - name: ALPHORN_WEBHOOK
              valueFrom:
                secretKeyRef:
                  name: alphorn
                  key: webhook-url
            - name: ALPHORN_API_KEY
              valueFrom:
                secretKeyRef:
                  name: alphorn
                  key: api-key
            - name: APP_VERSION
              value: "v1.2.3"
      restartPolicy: Never

Vercel

Use deploy webhooks: Vercel can call a URL on deploy events - point it at your Alphorn webhook endpoint.

  1. Go to Team Settings → Webhooks and add a webhook for deployment events (webhook availability depends on your Vercel plan, so check yours). Deploy Hooks under Project Settings → Git are the opposite direction: incoming URLs that trigger a deploy.
  2. Or use the Vercel API in a GitHub Action to POST to Alphorn after deploy completes

Platform deploy webhooks can't send an Authorization header, so create that webhook with the API key switched off (No API key (URL is the secret)) and keep the URL private. A GitHub Action step can send the header like the CI/CD examples.

Auto-detect recognizes Vercel webhooks (via the x-vercel-signature header) and formats deployment events such as started, succeeded, failed, and canceled. Failed deployments get priority 4. See Supported Sources.

Netlify

  1. In Alphorn, create a webhook with the API key switched off (No API key (URL is the secret)). Netlify can't send a custom Authorization header, so keep the URL private.
  2. In Netlify, open your site and go to Site configuration → Notifications → Deploy notifications
  3. Click Add notification → HTTP POST request
  4. Pick the event (for example Deploy failed or Deploy succeeded) and paste your Alphorn webhook URL
  5. Repeat for each event you want

Auto-detect recognizes Netlify deploy notifications and formats the deploy state, site, and branch. Failed deploys get priority 4. See Supported Sources.

Railway

  1. In Alphorn, create a webhook. Railway can send custom headers, so you can keep Require API key on.
  2. In your Railway project, open Settings → Webhooks, paste your Alphorn webhook URL, and add the custom header Authorization: Bearer <api-key>.
  3. Click Save Webhook. One webhook covers all environments of the project.

Railway webhooks are unsigned and have no vendor header: Auto-detect recognizes them by payload shape (a type like Deployment.failed plus resource.project). Failed and crashed deployments get priority 4, alerts take Railway's severity (CRITICAL 5, ERROR 4, WARNING 3). See Supported Sources.

Routing examples

The tags below are from the custom curl examples on this page. Auto-detected Vercel, Netlify, and Railway notifications use their own tags (see Supported Sources), for example vercel, netlify, and railway.

ChannelFilterPurpose
Slack (#deployments)Tags has any of deployAll deploy activity
Slack (#engineering)Tags has any of failureOnly failed deploys
PagerDutyPriority greater than 3 and tags has any of deployPage on-call for deploy failures
DiscordTags has any of successCelebrate successful releases

On this page