Skip to content

Commit 524d386

Browse files
committed
ci: Change build to support public ecr
1 parent 7264d4f commit 524d386

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/build-push.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ jobs:
3232
restore-keys: |
3333
${{ runner.os }}-buildx-
3434
35+
- name: Login to Amazon ECR Public
36+
id: login-ecr-public
37+
uses: aws-actions/amazon-ecr-login@v2
38+
with:
39+
registry-type: public
40+
3541
- name: Build Image
3642
uses: docker/build-push-action@v5
3743
with:
@@ -40,9 +46,18 @@ jobs:
4046
load: true
4147
cache-from: type=local,src=/tmp/.buildx-cache
4248
cache-to: type=local,dest=/tmp/.buildx-cache-new
43-
build_args: |
49+
build-args: |
4450
RUBY_VERSION=${{ steps.extract_refs.outputs.tag }}
4551
52+
- name: Build & Push Image
53+
uses: docker/build-push-action@v6
54+
with:
55+
load: true
56+
push: true
57+
tags: ${{ steps.login-ecr-public.outputs.registry }}/${{ vars.ECS_REGISTRY_ALIAS }}/${{ vars.ECS_REPOSITORY_NAME }}:${{ steps.extract_refs.outputs.tag }}
58+
cache-from: type=local,src=/tmp/.buildx-cache
59+
cache-to: type=local,dest=/tmp/.buildx-cache-new
60+
4661
- name: Push Image to Amazon ECR
4762
id: ecr_sha_ruby
4863
uses: jwalton/gh-ecr-push@v2

0 commit comments

Comments
 (0)