Skip to content

Commit

Permalink
ci(docker): use build with qemu instead of build
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardobridge committed May 22, 2024
1 parent 633cd1f commit b287020
Showing 1 changed file with 24 additions and 27 deletions.
51 changes: 24 additions & 27 deletions .github/workflows/docker-ecs-worker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ jobs:

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Replace package version
if: ${{ inputs.USE_COMMIT_SHA_IN_VERSION || false }}
Expand Down Expand Up @@ -95,19 +92,19 @@ jobs:
with:
registry-type: public

- name: Build and push Docker image (Public ECR)
- name: Build the Docker image (Public ECR)
if: matrix.registry == 'public'
uses: docker/build-push-action@v4
env:
DOCKER_IMAGE_TAG: ${{ env.WORKER_VERSION }}-${{ matrix.platform_name }}
with:
context: .
file: ./packages/artillery/lib/platform/aws-ecs/worker/Dockerfile
push: true
tags: public.ecr.aws/d8a4z9o5/artillery-worker:${{ env.DOCKER_IMAGE_TAG }}
platforms: ${{ matrix.platform }}
build-args: |
WORKER_VERSION=${{ env.WORKER_VERSION }}
env:
DOCKER_TAG: ${{ env.WORKER_VERSION }}-${{ matrix.platform_name }}
run: |
docker build . --platform ${{ matrix.platform }} --build-arg="WORKER_VERSION=${{ env.WORKER_VERSION }}" --tag public.ecr.aws/d8a4z9o5/artillery-worker:${{ env.DOCKER_TAG }} -f ./packages/artillery/lib/platform/aws-ecs/worker/Dockerfile
- name: Push Docker image (Public ECR)
if: matrix.registry == 'public'
env:
DOCKER_TAG: ${{ env.WORKER_VERSION }}-${{ matrix.platform_name }}
run: |
docker push public.ecr.aws/d8a4z9o5/artillery-worker:${{ env.DOCKER_TAG }}
- name: Configure AWS Credentials (Private ECR)
if: matrix.registry == 'private'
Expand All @@ -124,18 +121,18 @@ jobs:
id: login-ecr-private
uses: aws-actions/amazon-ecr-login@v1

- name: Build and push Docker image (Private ECR)
- name: Build the Docker image (Private ECR)
if: matrix.registry == 'private'
uses: docker/build-push-action@v4
env:
DOCKER_IMAGE_TAG: ${{ env.WORKER_VERSION }}-${{ matrix.platform_name }}
with:
context: .
file: ./packages/artillery/lib/platform/aws-ecs/worker/Dockerfile
push: true
tags: 248481025674.dkr.ecr.eu-west-1.amazonaws.com/artillery-worker:${{ env.DOCKER_IMAGE_TAG }}
platforms: ${{ matrix.platform }}
build-args: |
WORKER_VERSION=${{ env.WORKER_VERSION }}
env:
DOCKER_TAG: ${{ env.WORKER_VERSION }}-${{ matrix.platform_name }}
run: |
docker build . --platform ${{ matrix.platform }} --build-arg="WORKER_VERSION=${{ env.WORKER_VERSION }}" --tag 248481025674.dkr.ecr.eu-west-1.amazonaws.com/artillery-worker:${{ env.DOCKER_TAG }} -f ./packages/artillery/lib/platform/aws-ecs/worker/Dockerfile
- name: Push Docker image (Private ECR)
if: matrix.registry == 'private'
env:
DOCKER_TAG: ${{ env.WORKER_VERSION }}-${{ matrix.platform_name }}
run: |
docker push 248481025674.dkr.ecr.eu-west-1.amazonaws.com/artillery-worker:${{ env.DOCKER_TAG }}

0 comments on commit b287020

Please sign in to comment.