Skip to content

Commit bd0996d

Browse files
committed
Update on_release.yml workflow to push to staging ECR repo
This also updates the docker/build-push-action to v6, as v2 does not support the provenance option Signed-off-by: HanleyYin <[email protected]>
1 parent afb9476 commit bd0996d

File tree

2 files changed

+49
-4
lines changed

2 files changed

+49
-4
lines changed

.github/workflows/on-push-to-main-branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
echo TAG_BASE=$TAG_BASE >> $GITHUB_ENV
3939
echo PLUGIN_VERSION=$PLUGIN_VERSION >> $GITHUB_ENV
4040
- name: Build and push container images
41-
uses: docker/build-push-action@v2
41+
uses: docker/build-push-action@v6
4242
with:
4343
build-args: |
4444
pkg_version=${{ env.PLUGIN_VERSION }}

.github/workflows/on-release.yml

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ on:
77

88
env:
99
ECR_REPO: public.ecr.aws/k1n1h4h4
10-
10+
STAGING_REPO: 105154636954.dkr.ecr.us-east-1.amazonaws.com
11+
1112
jobs:
1213
build:
1314
name: release
@@ -34,17 +35,61 @@ jobs:
3435
registry: public.ecr.aws
3536
env:
3637
AWS_REGION: us-east-1
37-
- name: Setup Push to ECR
38+
- name: Setup Push to Public ECR
3839
run: |
3940
export TAG_BASE=${{ env.ECR_REPO }}/$(echo $GITHUB_REPOSITORY | sed s#/#-#)
4041
echo TAG_BASE=$TAG_BASE >> $GITHUB_ENV
4142
- name: Build and push container images
42-
uses: docker/build-push-action@v2
43+
uses: docker/build-push-action@v6
44+
with:
45+
build-args: |
46+
pkg_version=${{ steps.tag.outputs.tag }}
47+
context: .
48+
platforms: linux/amd64,linux/arm64
49+
tags: |
50+
${{ env.TAG_BASE }}:latest
51+
${{ env.TAG_BASE }}:${{steps.tag.outputs.tag}}
52+
push: true
53+
- name: Login to Staging ECR
54+
uses: docker/login-action@v1
55+
with:
56+
registry: 105154636954.dkr.ecr.us-east-1.amazonaws.com
57+
env:
58+
AWS_REGION: us-east-1
59+
- name: Setup Push to Staging ECR
60+
run: |
61+
export TAG_BASE=${{ env.STAGING_REPO }}/$(echo $GITHUB_REPOSITORY | sed s#/#-#)
62+
echo TAG_BASE=$TAG_BASE >> $GITHUB_ENV
63+
- name: Build and push arm image
64+
uses: docker/build-push-action@v6
65+
with:
66+
build-args: |
67+
pkg_version=${{ steps.tag.outputs.tag }}
68+
context: .
69+
platforms: linux/arm64
70+
provenance: false
71+
tags: |
72+
${{ env.TAG_BASE }}:${{steps.tag.outputs.tag}}-arm64
73+
push: true
74+
- name: Build and push amd image
75+
uses: docker/build-push-action@v6
76+
with:
77+
build-args: |
78+
pkg_version=${{ steps.tag.outputs.tag }}
79+
context: .
80+
platforms: linux/amd64
81+
provenance: false
82+
tags: |
83+
${{ env.TAG_BASE }}:${{steps.tag.outputs.tag}}-amd64
84+
push: true
85+
- name: Build and push manifest list
86+
uses: docker/build-push-action@v6
4387
with:
4488
build-args: |
4589
pkg_version=${{ steps.tag.outputs.tag }}
4690
context: .
4791
platforms: linux/amd64,linux/arm64
92+
provenance: false
4893
tags: |
4994
${{ env.TAG_BASE }}:latest
5095
${{ env.TAG_BASE }}:${{steps.tag.outputs.tag}}

0 commit comments

Comments
 (0)