Skip to content

Railway

Run Smoketest after Railway deployment status webhooks or CI deploys.

View as Markdown

Railway project webhooks can notify external services about deployment status changes. Use them for basic fixed-URL testing, or call Smoketest from CI when you need full metadata.

Basic mode: Railway webhook

  1. Create a deployment webhook in Smoketest.
  2. In Railway, add a project webhook.
  3. Select deployment status events and filter to successful deploys if your Railway plan/settings allow it.
  4. Paste the Smoketest trigger URL as the endpoint.

Smoketest ignores Railway-specific JSON fields and runs the webhook target. This works best when your test URL is already the Railway production URL.

Full metadata mode: CI deploy

Use a CI step when you want to pass the final domain, commit SHA, and idempotency key.

.github/workflows/railway-smoketest.yml
name: Deploy to Railway and run Smoketest

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Deploy to Railway
        run: railway up --detach
        env:
          RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
      - name: Trigger Smoketest
        run: |
          curl -sf -X POST -G "$SMOKETEST_DEPLOYMENT_WEBHOOK_URL" \
            -H "Idempotency-Key: ${{ github.run_id }}-${{ github.run_attempt }}" \
            --data-urlencode "targetUrl=$DEPLOYMENT_URL" \
            --data-urlencode "commitSha=${{ github.sha }}" \
            --data-urlencode "branch=${{ github.ref_name }}" \
            --data-urlencode "externalId=${{ github.run_id }}-${{ github.run_attempt }}"
        env:
          SMOKETEST_DEPLOYMENT_WEBHOOK_URL: ${{ secrets.SMOKETEST_DEPLOYMENT_WEBHOOK_URL }}
          DEPLOYMENT_URL: https://app.example.com

If your Railway deployment URL changes per environment, set DEPLOYMENT_URL from your Railway environment or deployment output before calling Smoketest.

On this page