/cicd-demo

Example of usage gradle with spotless and jib. The simplest spring boot http server formatted with spotless, packed in a docker image with jib via github actions and pushed to github packages.

Primary LanguageJava

jib with github packages and spotless example

Checkstyle

./gradlew build

Will run :spotlessJavaCheck task to check code for style violations

Code can be reformated according to style rules via

./gradlew spotlessApply

Build

Build image locally with docker and push it in local repo

./gradlew jibDockerBuild

Now limitium/cicd-demo image is available and can be tested via TestContainers

./gradlew test

Publish

Build image w/o docker demon and push tar to ghcr.io

./gradlew jib \
    -Djib.to.image=ghcr.io/limitium/cicd-demo:latest \
    -Djib.to.auth.username=limitium \
    -Djib.to.auth.password={ghp_TOKEN}