Deploy subfolders in monorepo

The base path is used only for setting the root of the project, that is, it’s the path where package.json, netlify.toml, etc. would be searched for.

Publish path is the root of the website. So, if you publish nunogt/public, it would be available at the root of the domain. The only way to make it available at https://devopspt.netlify.app/nunogt/ is to have a folder named nunogt with all the files inside the publish folder.

So, what you’re looking to achieve, that is, build multiple Gatsby websites and publish them all in their sub-folders might not be possible easily. You might have to try getting creative with your build command like cd <path to first website> && gatsby build && mv public ../ && cd <path to second website> && gatsby build... and so on. It’s just a guess and might not even work.

The only other way would be to build locally, move the files in the structure you want and either manually upload the build to Netlify or use a repo to push the pre-built files there.

It would be interesting to see if there are better ways of doing this.

1 Like