Published in


From PolyRepo to MonoRepo architecture using Github CI/CD

Managing MonoRepo having its own positives and negatives. But most of the products are moving towards MonoRepo architecture.

I am having some example to maintain a MonoRepo from MultiRepo architecture.

For this experiment we can have two individual repositories (repo1, repo2). The objective is to push these two codes to mono_repo when commit new changes.

Private Access Token

Create Private Access Token (PAT) in your github https://github.com/settings/tokens to give the access to commit the code programmatically. And select all repo access and give the name as PAT_TOKEN

Add workflow.yaml on both repo1 and repo2

on: pushjobs:
runs-on: ubuntu-latest
name: Replicate File
- name: Checkout current repo
uses: actions/checkout@v2
path: ./repo
- name: Checkout MonoRepo
uses: actions/checkout@master
repository: muthugit/mono_repo
token: ${{ secrets.PAT_TOKEN }}
path: ./mono_repo
- name: Copy/Create file
run: |
cp ./repo/README.md ./mono_repo/repo1.md
- name: Push to mono_repo
run: |
cd ./mono_repo
git add .
git config user.name github-actions
git config user.email github-actions@github.com
git commit -am "File Replicated from Project A"
git push

Copy the same YAML in repo2

When you commit code on either repo1 or repo2 the latest code will be available on the mono_repo


This way we can manage MonoRepo for a project where multiple dependencies are there




Recommended from Medium

How to make Python Packages part of Yocto generated Image?

Hadoop yarn distributed shell example on MAC

Different Career Opportunities in SAP HANA

A Quick Start Guide to PostgreSQL

Build better products by making Sprint Reviews fun.

World of Docker and Understanding

Generate your own favourite TV episode using python

Difference between Bootstrap 4 & Bootstrap 5

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


» 6+ years of experience in Data engineering, Dashboard designing » 3+ years of experience in Web application development

More from Medium

Backup & Archive with AWS

Core & Embedded DevOps

[AWS API Gateway, EKS] Access an Amazon EKS Cluster with an API Gateway!!

Build and Push a Docker image to AWS ECR with Pulumi : Part 3(with Azure DevOps and Semantic…