![]() |
Let’s say we have two or more developers who are merging code into a single repository. There can be issues in merging code from different developers. So the Continuous Integration tools help in solving not just that but many other things like:
One of the tools that we will be using here is GitHub Actions to accomplish our CI workflow. It is a powerful tool that can be utilized for continuous deployment as well. Prerequisites:
Step-by-Step ImplementationStep 1: Let’s create a basic Spring boot project firsta). Go to https://start.spring.io/
b). Open in IntelliJ. Run the following command in the terminal
c). Create following folders (….\demo-springgithubactions\.github\workflows\build.yml) and file (build.yml) which will be detected and used by github to run workflows using github actions. d). Update the file with following code
e). Create following folders (….\src\main\java\com\example\demospringgithubactions\controller\HelloWorld.java) and file (HelloWorld.java). f). Update the file with following code. Java
g). Create following folders (….\src\test\java\com\example\demospringgithubactions\DemoSpringgithubactionsApplicationTests.java) and file (DemoSpringgithubactionsApplicationTests.java).
Java
i). Run the code and verify if you are able to hit “http://localhost:8080/” end point with message dispalyed “Yaay!! you did it XD”. Step 2: Let’s push our code to GitHub
Step 3: Go to Github actions tab and you will see the job running automatically |
Reffered: https://www.geeksforgeeks.org
Advance Java |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |