Handle workspace/monorepo with different deployments

23 Views Asked by At

I am using yarn workspaces in which I have 3 projects.

My-project
   folder-1
   folder-2
   folder-3

Some devs work on folder-1, others on folder-2 and the rest on folder-3. The flow of the release is the following:

  • PRs are created on feature branches and merged to develop.
  • The process of PRs continue and they all get merged to develop. At some point, we decide whether release is due, so develop is merged into main branch.
  • From main, we create a release candidate and deploy scripts on productions are run.

The problem that happens for us is that folder-3 project needs to be released much quicker(every day), whereas folder-1's release happens very rarely(every month) even though folder-1 changes every day(it's just release must happen every month).

The problem: When the team works on feature branches and merges things to develop, it happens that develop branch ends up containing folder-1 and folder-3's changed files. If we want to release folder-3 every day, we got no choice but to merge develop into main in which case changed folder-1’s code also moves into main which is not ideal, because folder-1’s release must happen every month, not every day.

One thing that I looked into is using git checkout /paths which only moves the specific folder from one branch to another - i.e I could use this to only move folder-1 from develop to main, but I am not sure if this is the right and best practice.

0

There are 0 best solutions below