Self-hosted gitlab ci/cd step after deploy preview

Hiya @confusus.

Have you seen this article on the topic? [Support Guide] Testing your Netlify builds

It describes several options for testing, but my preferred alternative to what you are doing is:

  • lock deploys so we don’t autopublish new commits
  • send deploy notifications to your CI server (maybe gitlab?) with every deploy
  • potentially filter those notifications at the CI server (or via zapier, who could for instance choose NOT to forward builds for deploy-previews since you don’t need to e2e test MR’s)
  • have it kick off tests which can take as long as you like
  • if successful, you can via API publish an existing deploy and re-lock; something like these two calls:
  1. Netlify API documentation
  2. Netlify API documentation

Hopefully that helps!