GitHub Actions
Trigger Smoketest deployment webhooks from GitHub Actions after a deploy finishes.
Use GitHub Actions when your deployment already runs in a workflow, or when your host emits GitHub deployment status events. This path gives Smoketest the best metadata: preview URL, commit SHA, branch, and an idempotency key.
Before you start
- Create a deployment webhook in Smoketest.
- Store the trigger URL as a GitHub Actions secret named
SMOKETEST_DEPLOYMENT_WEBHOOK_URL. - If you want GitHub checks, bind the Smoketest webhook to a mapped GitHub repository.
After a deployment status
Use this when another platform creates GitHub deployments and marks them successful.
name: Smoketest
on:
deployment_status:
jobs:
smoketest:
if: github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
steps:
- name: Trigger Smoketest
run: |
curl -sf -X POST -G "$SMOKETEST_DEPLOYMENT_WEBHOOK_URL" \
-H "Idempotency-Key: ${{ github.event.deployment.id }}" \
--data-urlencode "targetUrl=${{ github.event.deployment_status.environment_url }}" \
--data-urlencode "commitSha=${{ github.sha }}" \
--data-urlencode "branch=${{ github.ref_name }}" \
--data-urlencode "externalId=${{ github.event.deployment.id }}"
env:
SMOKETEST_DEPLOYMENT_WEBHOOK_URL: ${{ secrets.SMOKETEST_DEPLOYMENT_WEBHOOK_URL }}After a deploy job
Use this when the same workflow builds, deploys, and then triggers Smoketest.
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy
run: ./scripts/deploy.sh
- 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://staging.example.comReplace DEPLOYMENT_URL with the URL your deploy step produces. For fixed production tests, omit targetUrl and Smoketest uses the saved test URL.
GitHub checks
If the webhook is bound to a mapped repository and the request includes commitSha, Smoketest creates one aggregate check named Smoketest / <webhook name>.
For repository-native PR and push rules, use the GitHub integration instead.