From dbb80f00a7bb44fdb8be732a23d638eb5358266b Mon Sep 17 00:00:00 2001 From: twerthi Date: Thu, 11 Jul 2024 16:28:36 -0700 Subject: [PATCH] Trying a new approach. --- github/java-microservice/action.yaml | 32 +++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/github/java-microservice/action.yaml b/github/java-microservice/action.yaml index 957d001..8d3510c 100644 --- a/github/java-microservice/action.yaml +++ b/github/java-microservice/action.yaml @@ -370,16 +370,28 @@ runs: # shell: bash # working-directory: java/${{ inputs.service_directory }} - - name: Build and push Dockerhub - uses: docker/build-push-action@v6 - with: - platform: linux/amd64,linux/arm64 - push: true - tags: | - octopussamples/octopub-${{ inputs.service_directory }}-mysql:${{ steps.determine_version.outputs.semVer }} - octopussamples/octopub-${{ inputs.service_directory }}-mysql:latest - context: . - file: java/${{ inputs.service_directory }}/src/main/docker/Dockerfile.legacy-jar + The MySQL Docker image is built and pushed. + - name: Build, tag, and push image to Dockerhub + if: ${{ inputs.docker_build == 'true' }} + run: | + docker buildx -f src/main/docker/Dockerfile.legacy-jar -t octopussamples/octopub-${{ inputs.service_directory }}-mysql:${{ steps.determine_version.outputs.semVer }} --platform=linux/amd64,linux/arm64 . + docker push octopussamples/octopub-${{ inputs.service_directory }}-mysql:${{ steps.determine_version.outputs.semVer }} + docker tag octopussamples/octopub-${{ inputs.service_directory }}-mysql:${{ steps.determine_version.outputs.semVer }} octopussamples/octopub-${{ inputs.service_directory }}-mysql:latest + docker push octopussamples/octopub-${{ inputs.service_directory }}-mysql:latest + shell: bash + working-directory: java/${{ inputs.service_directory }} + + + # - name: Build and push Dockerhub + # uses: docker/build-push-action@v6 + # with: + # platform: linux/amd64,linux/arm64 + # push: true + # tags: | + # octopussamples/octopub-${{ inputs.service_directory }}-mysql:${{ steps.determine_version.outputs.semVer }} + # octopussamples/octopub-${{ inputs.service_directory }}-mysql:latest + # context: . + # file: java/${{ inputs.service_directory }}/src/main/docker/Dockerfile.legacy-jar - name: Login to GHCR uses: docker/login-action@v3