Actions
-
Build "java-spring-boot-gradle" action (see: build-java-spring-boot-gradle.yaml). This action will build the Docker image (will run tests during the build) and will push it to the GitHub Packages. Push to
master
with changes injava-spring-boot-gradle/*
directory will automatically trigger this action (in can be easily customized forpull_request
trigger as well). Tests coverage and vulnerability analysis can also be implemented. And Git tags can be used for Docker tags if necessary. -
Deploy "java-spring-boot-gradle" manual action (see: deploy-java-spring-boot-gradle.yaml). This action can be used to deploy a specified tag, that was pushed by
build-java-spring-boot-gradle
action (see: all tags). It will make sure that the tag exists in the registry (it will not deploy non-existent tag). At the final step it will just show the image that should be deployed (deploy logic can be various, based on the requirements).
Local build
cd java-spring-boot-gradle
docker build . --progress plain --tag java-spring-boot-gradle
Start application
Local version:
docker run --rm --tty --interactive --publish 8080:8080 java-spring-boot-gradle
Published version:
docker run --rm --tty --interactive --publish 8080:8080 ghcr.io/nickola/github-actions-examples/java-spring-boot-gradle:latest
Access started application
curl http://localhost:8080
Output:
{"data": "Hello world!"}