How to Deploy SpringBoot App to Elastic Beanstalk Using Github Actions CI/CD

Ruby Valappil
Javarevisited
Published in
4 min readFeb 17, 2022

--

Github Actions

The above image gives an overview of this article.

We will build a spring-boot application using Java and Maven and deploy it to AWS Elastic Beanstalk. Instead of manually deploying our application to AWS we will create a CI/CD pipeline using GitHub Actions for deployment.

If you followed my previous articles, you would have read about the SaaS application that was deployed to an EC2 instance, we are going to reuse the same code in this article but you can choose to use any spring-boot application to try the steps given here.

Before getting into the implementation, let’s try to refresh our memory on how Github Actions work. (we will not cover how GitHub Actions work in this article)

Implementation

Step 1: Create or download a Spring-Boot application.

We know that the default port where tomcat runs is 8080 and that’s where we access our spring-boot application as well. As we start using a registry or have more than one spring-boot app running in our local, we define the server port explicitly in the application property or yml file. Something similar needs to be done while deploying a code to AWS beanstalk. AWS has Nginx running at port 80 and that internally points to port 5000 by…

--

--