Deploy notifications on your phone
Your deploy finished. You find out by refreshing the dashboard or checking the terminal you left open.
Here’s how to get notified wherever you are.
The universal pattern: curl at the end of any deploy step
#!/bin/bash
set -e
./build.sh
./deploy.sh
curl -s -X POST "https://trigger.fyi/$TRIGGER_FYI_SECRET_KEY" \
-d "Deploy complete: $(git rev-parse --short HEAD)"Works in any shell-based deploy pipeline. set -e means a failure exits before the notification — add a trap for failure notifications:
#!/bin/bash
set -e
notify_failure() {
curl -s -X POST "https://trigger.fyi/$TRIGGER_FYI_SECRET_KEY" \
-H "Content-Type: application/json" \
-d "{\"title\":\"Deploy failed\",\"body\":\"$(git rev-parse --short HEAD)\",\"level\":\"critical\"}"
}
trap notify_failure ERR
./build.sh
./deploy.sh
curl -s -X POST "https://trigger.fyi/$TRIGGER_FYI_SECRET_KEY" \
-d "Deploy complete: $(git rev-parse --short HEAD)"GitHub Actions
- name: Notify
if: always()
run: |
STATUS="${{ job.status }}"
SHA="${{ github.sha }}"
BRANCH="${{ github.ref_name }}"
if [ "$STATUS" = "success" ]; then
curl -s -X POST "https://trigger.fyi/$TRIGGER_FYI_SECRET_KEY" \
-H "Content-Type: application/json" \
-d "{\"title\":\"Deploy complete\",\"body\":\"${BRANCH} · ${SHA:0:7}\",\"level\":\"log\"}"
else
curl -s -X POST "https://trigger.fyi/$TRIGGER_FYI_SECRET_KEY" \
-H "Content-Type: application/json" \
-d "{\"title\":\"Deploy failed\",\"body\":\"${BRANCH} · ${SHA:0:7}\",\"level\":\"critical\"}"
fi
env:
TRIGGER_FYI_SECRET_KEY: ${{ secrets.TRIGGER_FYI_SECRET_KEY }}Successful deploys use log — recorded in the feed, no push. Failures use critical — pushes immediately.
Vercel deploy hooks
Vercel doesn’t natively POST to arbitrary endpoints on deploy, but you can use the CLI in CI:
# In your GitHub Actions workflow
- name: Deploy
run: vercel --prod --token ${{ secrets.VERCEL_TOKEN }}
- name: Notify
if: always()
run: |
curl -s -X POST "https://trigger.fyi/$TRIGGER_FYI_SECRET_KEY" \
-d "Vercel deploy ${{ job.status }}: ${{ github.ref_name }}"
env:
TRIGGER_FYI_SECRET_KEY: ${{ secrets.TRIGGER_FYI_SECRET_KEY }}Railway
Railway supports deploy hooks under Settings → Deploy → Deploy Hook. Since trigger.fyi accepts any POST, you can use Railway’s webhook with a short relay:
// A small endpoint that receives Railway's webhook and notifies
export async function POST(req) {
const body = await req.json()
fyi("Railway deploy", {
body: `${body.status} · ${body.environment}`,
service: body.service?.name,
status: body.status
})
return new Response("OK")
}Or use Railway’s CLI in your build command:
# In Railway's start command or a build script
railway up && curl -s -X POST "https://trigger.fyi/$TRIGGER_FYI_SECRET_KEY" -d "Deployed"Fly.io
# fly.toml or deploy script
fly deploy
curl -s -X POST "https://trigger.fyi/$TRIGGER_FYI_SECRET_KEY" \
-d "Fly deploy complete: $(fly status --json | jq -r '.Hostname')"Cloudflare Workers (wrangler)
wrangler deploy && \
curl -s -X POST "https://trigger.fyi/$TRIGGER_FYI_SECRET_KEY" \
-d "Worker deployed: $(wrangler deployments list --limit 1 | tail -1)"In Node.js deploy scripts
import { execSync } from "child_process"
import fyi from "trigger.fyi"
async function deploy() {
const start = Date.now()
try {
execSync("./build.sh && ./deploy.sh", { stdio: "inherit" })
const elapsed = Math.round((Date.now() - start) / 1000)
fyi.log("Deploy complete", {
body: `${elapsed}s · ${getShortSha()}`,
branch: process.env.BRANCH || "main",
env: "production"
})
} catch (err) {
fyi.critical("Deploy failed", {
body: getShortSha(),
branch: process.env.BRANCH || "main"
})
process.exit(1)
}
}
function getShortSha() {
return execSync("git rev-parse --short HEAD").toString().trim()
}
deploy()What level to use
- Successful deploys:
fyi.log()— visible in feed, no push. You don’t need to be interrupted for a normal deploy. - Failed deploys:
fyi.critical()orfyi()— push to your phone. You want to know. - Slow deploys:
fyi()— normal push when it finally finishes after a long wait.
Setup
npx trigger.fyiGenerates a key, subscribes your device. Add TRIGGER_FYI_SECRET_KEY to your CI secrets and environment. Done.
Related: GitHub Actions notifications · Webhook notifications to your phone · The curl guide to trigger.fyi · What is trigger.fyi?