1. Putting It On GitHub
We have 2 Spring projects, so we are making 2 separate repositories, one for each microservice.
2. Building Jar And Docker Image
Instead of building manually on our local machine, we will utilize GitHub Actions to automatically compile our JAR file and build our Docker Image on every push!
3. Creating Dockerfile
Even though the build process is fully automated via CI/CD, GitHub Actions still requires a Dockerfile in the root of the repository to understand how to construct the image.
3.1. Understanding Dockerfile Commands
This is an optional chapter designed to help you deeply understand what each line in the Dockerfile accomplishes.
4. Creating DockerHub Account
DockerHub is a cloud registry where your CI/CD pipeline will automatically push the built Docker images.
7. Connecting DockerHub to GitHub
Never hardcode your passwords or tokens inside your GitHub Actions pipeline files (.yml). They must be securely stored in GitHub Secrets!