Skip to content

Netlify

Run Smoketest after Netlify deploy notifications or CI-controlled deployments.

View as Markdown

Netlify can notify external services when deploys change state. Smoketest can receive those notifications for basic post-deploy runs, or you can call Smoketest from CI for full deployment metadata.

Basic mode: Netlify deploy notification

Use this when the Smoketest test's saved URL is the URL you want to test.

  1. Create a deployment webhook in Smoketest.
  2. In Netlify, open the site's deploy notification settings.
  3. Add an outgoing webhook for successful deploys.
  4. Use the Smoketest trigger URL as the webhook destination.

Netlify sends a platform JSON payload. Smoketest ignores unknown fields and queues the webhook target. This is enough for fixed production URLs.

Full metadata mode: CI after deploy

Use this when you need the exact deploy preview URL, commit SHA, idempotency, or GitHub checks.

.github/workflows/netlify-smoketest.yml
name: Deploy to Netlify and run Smoketest

on:
  pull_request:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Deploy to Netlify
        id: deploy
        run: |
          DEPLOY_OUTPUT="$(netlify deploy --build --json)"
          DEPLOYMENT_URL="$(echo "$DEPLOY_OUTPUT" | jq -r '.deploy_url // .url')"
          echo "deployment_url=$DEPLOYMENT_URL" >> "$GITHUB_OUTPUT"
      - 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=${{ steps.deploy.outputs.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 }}

GitHub checks

For GitHub checks, bind the Smoketest webhook to a mapped GitHub repository and include commitSha. Native Netlify deploy notifications alone usually do not give Smoketest the normalized fields it needs for checks.

On this page