diff --git a/.github/workflows/build-candidate.yml b/.github/workflows/build-candidate.yml index 66cf8c16..f7655970 100644 --- a/.github/workflows/build-candidate.yml +++ b/.github/workflows/build-candidate.yml @@ -25,17 +25,14 @@ jobs: java-version: 21 distribution: temurin - - name: Gradle CI + - name: Build OCI Image uses: gradle/gradle-build-action@v2 with: - arguments: build + arguments: clean bootBuildImage --imageName=${{ secrets.DOCKER_REGISTRY_URL }}/cmsch:rc build-root-directory: backend - - name: Build and Push Docker Image - run: | - docker buildx create --use - docker buildx inspect --bootstrap - docker buildx build --platform linux/amd64 --push -t ${{ secrets.DOCKER_REGISTRY_URL }}/cmsch:rc -f ./backend/Dockerfile ./backend + - name: Push OCI Image + run: docker push ${{ secrets.DOCKER_REGISTRY_URL }}/cmsch:rc - name: Logout from Docker Registry run: docker logout ${{ secrets.DOCKER_REGISTRY_URL }} diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 20d7f241..4b0780a6 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -25,17 +25,14 @@ jobs: java-version: 21 distribution: temurin - - name: Gradle CI + - name: Build OCI Image uses: gradle/gradle-build-action@v2 with: - arguments: build + arguments: clean bootBuildImage --imageName=${{ secrets.DOCKER_REGISTRY_URL }}/cmsch:release build-root-directory: backend - - name: Build and Push Docker Image - run: | - docker buildx create --use - docker buildx inspect --bootstrap - docker buildx build --platform linux/amd64 --push -t ${{ secrets.DOCKER_REGISTRY_URL }}/cmsch:release -f ./backend/Dockerfile ./backend + - name: Push OCI Image + run: docker push ${{ secrets.DOCKER_REGISTRY_URL }}/cmsch:release - name: Logout from Docker Registry run: docker logout ${{ secrets.DOCKER_REGISTRY_URL }} diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index dba25ac9..cb1d51ae 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -88,6 +88,16 @@ tasks.withType { } } +tasks.getByName("bootBuildImage") { + builder = "paketobuildpacks/builder-jammy-tiny" + environment = mapOf( + "BP_NATIVE_IMAGE" to "false", + "CDS_TRAINING_JAVA_TOOL_OPTIONS" to "-Dspring.profiles.include=prewarm", + "BP_JVM_CDS_ENABLED" to "true", + "BPL_JVM_THREAD_COUNT" to "25" + ) +} + tasks.withType { useJUnitPlatform() }