Enable build for sites without git repository attached

It’d be awesome if I can upload some code & make Netlify build it in the usual manner.
As far as I can tell it’s only possible to employ Netlify builds if you have the repository attached (not quite sure regarding reasons for this though).

My use-case is that I want to dynamically generate new sites on-demand, and it doesn’t really make sense for me to set up a new git repository just to use it as a Netlify source, given that I can upload things directly. Right now I’m looking into setting up infrastructure to do the build myself before uploading things to Netlify, but it’d be awesome if I can delegate that to Netlify

Heya @stvad and thanks for the suggestion! Yup, our CI is based around “get notified of new commit, pull repo, build”, so we haven’t implemented any other methods to build. As you’ve discovered, you can build locally and send to us via API, which would have been my suggestion had you not already discovered it.

You could create a repo instead that has the framework for building your new sites, and takes “parameters” in the form of a file you commit, and then we build and deploy in our container. Not sure how abstracted your create-site process is - if they all start from the same codebase with the same changes “update customer name + logo + color + ship”, or if they are more nuanced; it might be worth cramming that into a repo.

We also have folks who do commit their build OUTPUT to a repo, and let us deploy the site without building. Then, you update something (fix a typo), commit the build output to the repo, and we deploy.

Hey @fool, thank you for your suggestions!

I’m not quite sure I follow. My understanding is that 1 repository maps to one site? How do I create multiple sites from the same repository?

The underlying source code is the same, but users supply parameters & content.
The process is managed. So they fill out the form, upload some files, press a button & get the site.

That doesn’t help me :slight_smile: , I do want to delegate build to Netlify. And I don’t want to programmatically create repositories & connect them to Netlify sites for each user.


I’ve ended up setting up my own build infrastructure, but that involves bunch of complexity to set up and maintain. It’d be nice if I didn’t have to do that and could just upload source to Netlify as it happens with “no build” scenario, but, well for build to be triggered in that case.

Hey @stvad ,

Depending on how many sites you spin up, you could make use of a monorepo. One repo, many sites – and even the option for commonalities and shared components!

You might even be able to use Octokit for the GitHub automation. Just my 2c!

1 Like

The number of sites is indeterminate & growing, but I hope to get to a state when it’s at least a few hundred.
Monorepo is quite an interesting approach. I think that may provide a workaround here :). Thought I suspect it may be cheaper for me to stick with my custom build infrastructure now that I have it :stuck_out_tongue:
I still think that the original request is valuable though !

1 Like