Configure
Deploy hook
Start a run after every deploy: GitHub Action, Vercel webhook or curl.
Updated
POST https://mystra.run/api/hooks/deploy/<appId> starts a run tagged with the commit. The URL and the signing secret are in App settings → Deploy hook. Store the secret as a CI secret, never in the repo.
- X-Mystra-Signature
- Header. The signing secret, as shown once in settings.
- commit
- Optional. A commit sha; the first seven characters are shown on the run.
- message
- Optional. The commit message, shown on the run.
- env
- Optional. Defaults to
production.
GitHub Action
Works with any host that reports GitHub Deployments, including Vercel's Git integration. Add MYSTRA_HOOK_SECRET to the repository secrets.
name: Tell Mystra
on: deployment_status
jobs:
notify:
if: github.event.deployment_status.state == 'success' && github.event.deployment.environment == 'Production'
runs-on: ubuntu-latest
steps:
- run: |
curl -fsS -X POST "https://mystra.run/api/hooks/deploy/<appId>" \
-H "X-Mystra-Signature: ${{ secrets.MYSTRA_HOOK_SECRET }}" \
-H "Content-Type: application/json" \
-d '{"commit":"${{ github.event.deployment.sha }}","env":"production"}'Vercel webhook
On a Vercel Pro or Enterprise team, add an account webhook (Team settings → Webhooks, event Deployment Succeeded) pointing at the same URL, and paste its secret into the app's Deploy hook settings. Mystra verifies x-vercel-signature and only acts on production deploys.
Anything else
curl -X POST https://mystra.run/api/hooks/deploy/<appId> \
-H "X-Mystra-Signature: $MYSTRA_HOOK_SECRET" \
-H "Content-Type: application/json" \
-d '{"commit":"'"$(git rev-parse --short HEAD)"'","env":"production"}'Responses
- 202
{ "ok": true, "queued": true }: a run is starting.- 200
{ "ok": true, "queued": false, "reason": "…" }: accepted but not run, for example a preview deploy, another project, a paused app, or the month's runs used up. See Plans and limits.- 401
- Bad signature.