Skip to content

Commit

Permalink
try using the build-and-push action
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyzli committed May 4, 2024
1 parent ba85b6d commit 37a56d4
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions .github/workflows/build-test-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

0 comments on commit 37a56d4

Please sign in to comment.