Continuous Deployment strategy with Github actions

Hi, I am a student and I am trying to apply CD to my project. I am able to continuously deploy a new microservice image to my AWS ECR which gets updated by Flux and updates the microservice in kubernetes AWS EKS.

But now I am unsure of how I should go around developing a branching strategy. I don’t think it is right to constantly deploy the microservice to the kubernetes cluster everytime there is a pull request.

For now my team and I have decided on naming the branches “backend/(component name)” and “frontend/(component name)” so that the test cases that I have for CI will run when a backend feature is push.

We are trying to imitate how a real development is like and trying to create a staging environment as well. For that part we are going to have CD for the Microservices only when they pass all the test cases in the CI. Is there a better alternative?

Is there a way for me to specify which branch the pull request comes from? I tried specifying it but it didn’t work so I assume I did it wrongly you can only pull request to master.

In summary I would like to know how to branch or use github actions to continuously deploy to my AWS services. Keeping in mind that I would also like to have a staging and production environment.

Current way:
For staging environment, it will only deploy when all the test cases in the CI is complete.

For production environment, it will always deploy when there is a pull request to master (Worry is that it would deploy unncessarily, i.e frontend code is changed but the backend MS were redeployed because of Github actions)

Thanks! :grinning:


Maybe you can reference to the Deployments API to set up deployment environments and deployments in your repository.