Skip to content

Heroku

Run Smoketest after Heroku releases and deploys.

View as Markdown

Use Smoketest after a Heroku release is live. For most teams, the simplest path is to call Smoketest from CI after deploying with Heroku Git or the Heroku CLI.

GitHub Actions

.github/workflows/heroku-smoketest.yml
name: Deploy to Heroku and run Smoketest

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Deploy to Heroku
        run: |
          git remote add heroku "https://heroku:${HEROKU_API_KEY}@git.heroku.com/${HEROKU_APP_NAME}.git"
          git push heroku HEAD:main
        env:
          HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
          HEROKU_APP_NAME: acme-production
      - 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://acme-production.herokuapp.com

Heroku app webhooks

Heroku app webhooks can notify external endpoints about release changes. You can point a release-success webhook at the Smoketest trigger URL for fixed-URL testing.

Direct Heroku webhooks send Heroku's JSON shape. Smoketest ignores unknown fields, so this mode queues runs against saved test URLs and does not pass targetUrl, commitSha, or externalId unless you add an adapter.

Release phase

Do not trigger Smoketest from Heroku release phase if the app is not live yet. Release phase runs before the new release is promoted, so a failing Smoketest call could also block the release. Prefer CI after deployment or Heroku app webhooks after release success.

On this page