Full Disclosure: I'm a DevOps noob.
I am running a MERN mono repo on an EC2 instance. Originally, I would always SSH into my machine, pull from the repository, and build again. But there are problems with this.. the build process takes longer and so when the SSH connection breaks at times, the build process gets terminated. This happens a lot making deploying difficult.
I thought about it, and I am sure there is a service that can do this: I can use a CI/CD pipeline in my repo (BitBucket), so when there is a commit on the main branch, it can ping my instance, and then there is an application running on my instance, which when it receives this ping, pulls, rebuilds and restarts the repo. Therefore, since it would be an application inside the EC2 there would a.) be no need to SSH in, and b.) be a reliable solution to deploy. Nice to have would be if there was anyways to monitor the build process when it is triggered.
I'm being unable to express my requirement hence I'm unable to look at the solutions available to do so, please suggest the same.