Can Netlify deliver "deploy" event to GitHub API after successful deployment?

We are deploying sites to Netlify and because the site is complex and has redirects would like to run a few end-to-end smoke tests on the deployed site to make sure everything is working.

Before we have configured things like CircleCI webhooks from Netlify to CircleCI, but this is too complex. I think a much cleaner approach would be to extend the existing GitHub commit status updates that Netlify sends with an additional one.

You can create a deployment status event using GitHub API (yeah, it is preview right now) Deployments - GitHub Docs

Then we could do just listen for “deploy” event in GitHub Action workflow and test the passed url

name: deployed
on: [deployment, deployment_status]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
         extract the deployed URL from the event object
         run tests against the URL
1 Like

We do not yet use that API, @bahmutov. I’ve added your name to the open feature request for us to do so, but I do not expect that to be implemented anytime soon.

@fool @bahmutov
I was exploring a similar idea. The issue with end-to-end tests for us is they require knowing when the Netlify “deploy” succeeded.
You can use GitHub repository or workflow dispatch events (triggered from the GitHub REST API):

If the Webhook notification was more customizable, changes to the post body, this webhook approach could be used to trigger the GitHub repository or workflow dispatch events.

I also thought I read that Netlify might release Deploy events into the whole build environment to compliment the Build events? Rumor or Truth?

I should clarify our use case is NOT simply “Deploy Preview” context builds (which can supply GitHub with the deploy success), but builds from branch merges etc.
I am currently working on a workflow that uses The Netlify GitHub App and GitHub workflow to execute more advance end-to-end tests. Using Java+Gradle+TestNG+SauceLabs.
IE 11 testing makes life … harder.

Yeah I am waiting for “official” deploy events delivered by the Netlify GitHub app

It’s been roughly a year now since this features has been requested. Are there any updates on this or plans you can share when this is going to be implemented?

Hi @Roxas92,

Sorry to disappoint, but there’s not a significant update in this area at the moment.

Too bad to read that no effort has been made to support that feature.

I use mainly the GitHub UI to code and collaborate. I switched back to vercel because they push deployment environment status on the GitHub UI and on every commit: it’s green or red! No need to search for feedback about deployment.

Anyway I’m interested about this feature on Netlify, is there a waiting list?

Hi @ChristoRibeiro,

Sorry to disappoint, but rest assured that this issue has been on the team’s radar. While there’s no news on if/when this would change, we’d update this thread if it does.

I also need to run E2E tests after deploys complete in Netlify. I think I can hack this together with github actions listening to the status event that Netlify posts back to PRs, but unfortunately there’s no way to configure a status update on a commit from a real deploy, only deploy previews. :frowning:

If you were to use some hacks, you could use event driven functions like deploy-building to post to some web hook, or your GitHub action. That might help.