SpringBoot 2.7 api service with Github Actions
- At least Java 11
- Install Docker Desktop.
- H2
- Docker
- Go to the main repo directory.
cd /springboot2-github-actions
- Install/package springboot2-github-actions.
mvn clean install
- Build the image of the service
docker build -t app .
- Run the service
docker run -p 8080:8080 app
curl --location --request GET 'http://localhost:8080/app/persons' \
--header 'Content-Type: application/json'
Response:
[
{
"id": 1,
"name": "Mike",
"gender": "Male",
"age": 50
},
{
"id": 2,
"name": "Rachel",
"gender": "Female",
"age": 98
},
{
"id": 3,
"name": "Tristan",
"gender": "Male",
"age": 5
},
{
"id": 4,
"name": "Sheryll",
"gender": "Female",
"age": 35
},
{
"id": 5,
"name": "Timon",
"gender": "Male",
"age": 51
}
]