Deploy multiple sites using a gatsby theme on netlifyJuly 22, 2019 at 10:33am (Edited 1 year ago)
I'm not sure if this was discussed before but I'm trying to deploy on netlify a monorepo that's using yarn workspaces. (I don't want to publish the theme at the moment)
I have the following structure:
Each site is using the theme inside the packages folder. In order to build each site I'm suppose to run yarn workspace first_site build and the same command for the other two sites. In package.json I can set up a global build command that will run all 3 build scripts for each site but what I don't know is what publish directory should I set in netlify since it's not a single site?
I'm kind of new to this whole setup with yarn workspaces and netlify, maybe I'm doing it wrong. Should I make a separate repo for each site instead?
July 22, 2019 at 2:36pm
July 26, 2019 at 6:06am
July 30, 2019 at 2:00pm
Mmm... but when you do a commit for the first_site the other one trigger e build too?
I'm using yarn workspaces too but then I think to use git submodules for my sites only and manage each one with its own repo.
Another way to think of it is that code is committed to the repo. (Not to the first_site.) Each site at Netlify is simply listening for new code at GitHub -- when a push is made to the GitHub repo, every Netlify site listening to that repo will trigger a deploy for itself.
Each site at Netlify can have unique deploy commands and 'public' directories. Perhaps can explain more about this solution?