Probably due to the recent changes regarding environment variables, it is no longer possible to import new project from Github, and have the first build complete successfully, if they require environment variables to work.
Steps:
- Add new site > Import an existing project
- Link to a Github repository
- Show advanced
- Add the required environment variable
- Press the “Deploy site” button
The first build will fail. If you hit the “Retry with latest branch commit”, the second build will work.
Again this is probably because the createSite endpoint (Netlify API documentation) does no longer support setting environment variables. The build starts without them, and calling the createEnvVars (Netlify API documentation) endpoint immediately after the createSite call is already too late, as the build already started.
We use this exact flow at DatoCMS, and this is currently impacting all of our users trying to run our demos. It seems that also your “Deploy to Netlify” button is having the same issues.
Please let us know how to proceed, thanks!