Quick question about CI interaction and deploys from Github

Hi there,

This is not about a specific problem I’m having, more a request for advice on how Netlify works.

Currently, Netlify owns the building and deployment of my angular application.
I want to continue to use Netlify for hosting, it’s an awesome solution and I’m really happy with it.
I would however, like to switch the ownership of build and test pipelines to github actions.

Currently my site deploys on commit to my main and dev branches. I want that behaviour to continue, but I want Github actions to run tests before a site is deployed.

Does a Netlify site connected to a github repository wait for a CI pass before deploying a site, if one is present? How should I build this process out?

Right now netlify is just npm build-ing, should I have actions npm build and test and then ship the artifact to netlify to be deployed? Should I npm test and then let Netlify npm build and deploy as it does today?

What do all you think?

Cheers

Alex

Hiya @AlexanderNZ,

There are a lot of ways to mix GHActions and Netlify.

First off, you could run things in parallel - have GH running the test, and then polling for the deploy to complete (using our API - see [Support Guide] Understanding and using Netlify's API for omse more details), before returning a status and/or publishing the deploy.

Or, you could indeed deploy from github actions using our CLI (cf https://docs.netlify.com/cli/get-started/) - I know there is some “published” action that does that - literally runs netlify deploy - but you could bake that into your own custom action pretty easily.

However, I can tell you that unless you configure github NOT to notify us, and instead have your ACTION notify us (probably through pre-configured buildhooks rather than in the automatic way: https://docs.netlify.com/configure-builds/build-hooks/) that we will NOT wait for anything except that notification to start your build here!

This article also has a lot of somewhat generic test patterns that may inspire:

Let us know what you come up with :slight_smile: