Setting up CI/CD Using GitHub Actions
GitHub Action is a task you want to achieve at a certain event.
For example, on Push to a master event, you want to build, run tests, create a docker image, push to docker hub, and deploy to Kubernetes.
Build, run, create, push, and deploy are all GitHub Actions.
GitHub has a repository in which you can find an action for pretty much any task you want to achieve, check it out.
You can also write a custom action but this is out of the scope of this tutorial.
Prerequisites
We will be deploying out sample application on google cloud platform Kubernetes using Helm3.
It is highly recommended to familiarize yourself with the following topics:
Defining the use case
We will write a sample application using spring boot (it doesn’t really matter) and we will run the following workflows:
- On push to Feature branch
Run tests
2. On push to Master branch
Run tests -> Push to docker hub -> Deploy to K8s