Deploy part of a repo, using Deploy to Netlify button

Hey folks,

I’m putting together a Github repo of some small starter templates to allow my customers to deploy a basic template to Netlify.
I am hoping to have multiple mini-apps (just a .js, .html and file in a folder), each of which can be deployed individually using the Deploy to Netlify button.

When clicking that button, it copies and deploys the entire repo.
Do you know if it is possible to have the Deploy to Netlify button copy and deploy only the sub-folder it is hosted in?

As an example, my repo looks like this:

  | example1
    | example1.js
    | example1.html
    | // Contains Deploy to Netlify button
  | example2
    | example2.js
    | example2.html
    | // Contains another Deploy to Netlify button

For this example, the Deploy button in the example1 folder should deploy the code in the example1 folder only


Hi there @dugjason and welcome to our community!

Our button does not support being “multiply” installed in single repos right now, even though we understand that many people like this monorepo convention.

For now you’ll have to either:

  • split them into multiple repositories
  • split them into multiple branches in the same repo; you can target a branch with a special link to the button (?branch=x query param)
  • or deploy the whole thing and instruct your users how to access each example

We do have an open feature request on the topic and the idea is great, so I’ve added your voice to it and will follow up here if things change. I don’t have any intuition that it would happen soon, though, to set expectations.

1 Like