Build and Deploy netlify with github actions

Hi there,

I am currently trying to implement a CD flow on my GitHub Actions that involves building and deploying to a staging website, running end-to-end tests on it, and then deploying to the production environment using Netlify’s CD mechanism. (2 different sites).

I have attempted to use build hooks, but I’m encountering an issue with the “Wait for Netlify Build and Deploy” action in my GitHub workflow. Specifically, it doesn’t seem to be using the same sha as the build hook, which is critical for me to validate that the website has been deployed before running the tests.

I would appreciate any suggestions on how to improve this flow and what is the best practice to run e2e tests before deploying my site to production.

Here is the current “Wait for Netlify Build and Deploy” action in my workflow:

  - name: Wait for Netlify Build and Deploy
    uses: probablyup/wait-for-netlify-action@3.2.0
    id: waitForDeployment
     site_id: ${{ secrets.NETLIFY_STAGING_SITE_ID }} 

Hi there, glad you found us :wave:t6: before we can help you, we need a little more information on the issues you are facing.

First, have you looked through this resource? It is a compilation of all of our build and deploy resources. This is a good starting point.

If you have worked through those guides and are still encountering issues please share the following information:

  • the name of your build instance: “
  • what you have already tried
  • any error messages you have received in your terminal window or in the developer console