From 37a56d4ab4a0b3008821dc5c488dac7f24e45793 Mon Sep 17 00:00:00 2001 From: Tommy Li Date: Fri, 3 May 2024 17:23:43 -0700 Subject: [PATCH] try using the build-and-push action --- .github/workflows/build-test-publish.yaml | 28 ++++++++++------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-test-publish.yaml b/.github/workflows/build-test-publish.yaml index 80090b5ee114..628525fb08d8 100644 --- a/.github/workflows/build-test-publish.yaml +++ b/.github/workflows/build-test-publish.yaml @@ -458,19 +458,15 @@ jobs: - name: Login to Amazon ECR id: login-ecr uses: aws-actions/amazon-ecr-login@v1 - - name: Build Docker Image and push - env: - DOCKER_IMAGE: otelcontribcol - BUILD_VERSION: ${{steps.create-version.outputs.BUILD_VERSION}} - GCR_ASIA_IMAGE: ${{secrets.GCR_ASIA_IMAGE}} - GCR_EUROPE_IMAGE: ${{secrets.GCR_EUROPE_IMAGE}} - GCR_US_IMAGE: ${{secrets.GCR_US_IMAGE}} - run: | - docker buildx build \ - --platform linux/amd64,linux/arm64 \ - -t 609927696493.dkr.ecr.us-west-2.amazonaws.com/opentelemetry-collector-contrib:${BUILD_VERSION} \ - -t ${GCR_ASIA_IMAGE}:${BUILD_VERSION} \ - -t ${GCR_EUROPE_IMAGE}:${BUILD_VERSION} \ - -t ${GCR_US_IMAGE}:${BUILD_VERSION} \ - -f ./cmd/otelcontribcol/Dockerfile \ - --push . + - name: build and push + uses: docker/build-push-action@v5 + with: + push: true + context: . + file: ./cmd/otelcontribcol/Dockerfile + platforms: linux/amd64,linux/arm64 + tags: | + 609927696493.dkr.ecr.us-west-2.amazonaws.com/opentelemetry-collector-contrib:${{steps.create-version.outputs.BUILD_VERSION}} + ${{secrets.GCR_ASIA_IMAGE}}:${{steps.create-version.outputs.BUILD_VERSION}} + ${{secrets.GCR_EUROPE_IMAGE}}:${{steps.create-version.outputs.BUILD_VERSION}} + ${{secrets.GCR_US_IMAGE}}:${{steps.create-version.outputs.BUILD_VERSION}}