GitHub Action Gradle buildBootImage

Viewed 342

Spring boot 2.3 onwards comes with Gradle tasks buildBootImage which creates a container and by default pushes it to docker.io/library. How can this task be customized, in the context of Gradle running in GitHub action to push the container to GHCR, ECR, or GCR; ie, when GitHub action executes ./gradlew buildBootImage

Gradle's buildBootImage task comes with the below config parameters block, what's the best way to set these values within the build script and how do we pass these values from GitHub actions?

tasks.getByName<BootBuildImage>("bootBuildImage") {
    imageName = "bestway to set image name"
    isPublish = true
    docker {
        publishRegistry {
            url = "best way to set container registry URL"
            username = "best way to set user name for CR"
            password = "best way to set password for CR"
        }
    }
}
0 Answers
Related