How to avoid 404 during external CI build and after failed builds?

I’m using GitHub Actions to build a website (vyos-community.netlify.app) and deploy it to Netlify.
For the record, this is the GH Actions workflow file: community.vyos.net/main.yml at main · vyos/community.vyos.net · GitHub

I’m quite happy with that workflow except for two issues:

  • Between the time the build is triggered by pushing to the repo and the time deploy succeeds, the website is completely empty, all pages return 404.
  • If a GH Actions workflow fails, the site remains empty forever.

What’s the best way to avoid those issues? Thanks in advance!

hey @dmbaturin , sorry to be slow to get back to you - truth is, nobody in our team really has in-depth knowledge of github actions :expressionless:
have you tried getting some answers from stackoverflow or other support forums for github actions? Uf yes, anything useful?

Well, this problem seems to have nothing to do with GitHub Actions as such, rather with the fact that the site is built using an external CI.

The site content disappears from the Netlify servers when a deploy is triggered by a push to the repo. The content disappears forever if the GitHub Action workflow fails before it had a chance to upload the new site files via the Netlify API.
The way I imagined it should work is that Netlify should do nothing to the site unless asked to via the API. Thus, either I’m missing some settings that control it, or it’s a fundamental misfeature of Netlify’s interaction with external CI workflows.

I couldn’t find any descriptions of the deploy trigger process. Could you confirm or deny that if I were using Netlify’s own build service, this problem wouldn’t happen?

Ok, I’ve found the setting I was missing.

If you are using an external CI, make sure to go to “Site settings”, “Build & deploy”, and set the “Builds” option to “Stop builds”.

1 Like