DEV Community

Discussion on: How would you deploy parts of a monorepo in CI?

Collapse
 
kingkool68 profile image
Russell Heimlich

I like to deploy projects by cloning the git repo in the root directory of the web server. Then to do an incremental update it's just a matter of doing a git pull to pull down the latest changes.

Here's a GitHub action I wrote that does that whenever a change to the master branch is pushed to the origin github.com/kingkool68/testing-gith...

Collapse
 
simonlegg profile image
Simon

Yeah, so assume the web and api were two separate standalone services, deployed to different servers, I guess that wouldn’t work?

Collapse
 
kingkool68 profile image
Russell Heimlich

You could use a Continuous Integration pipeline that automatically commits the changes to two different repos in a folder structure and deploy them to production as two separate repos while maintaining and authoring in one repo.

Or deploy the monorepo to production in a non-public folder and automatically move the two directories to different locations in the servers web root.

With a bit of scripting you could make this work.