Skip to content

Commit 60f22b5

Browse files
committed
ci: publish qemu image to prod repo
1 parent c024bbf commit 60f22b5

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

.github/workflows/qemu-image-build.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,40 @@ jobs:
109109
id: login-ecr-private
110110
uses: aws-actions/amazon-ecr-login@v2
111111

112-
- name: Build, tag, and push docker image to Amazon ECR
112+
- name: Build image
113+
env:
114+
IMAGE_TAG: ${{ steps.process_release_version.outputs.version }}
115+
run: |
116+
docker build -f Dockerfile-kubernetes -t "postgres:$IMAGE_TAG" .
117+
118+
- name: Push docker image to Amazon ECR
113119
env:
114120
REGISTRY: 812073016711.dkr.ecr.us-east-1.amazonaws.com
115121
REPOSITORY: postgres-vm-image
116122
IMAGE_TAG: ${{ steps.process_release_version.outputs.version }}
117123
run: |
118-
docker build -f Dockerfile-kubernetes -t "$REGISTRY/$REPOSITORY:$IMAGE_TAG" .
124+
docker tag "postgres:$IMAGE_TAG" "$REGISTRY/$REPOSITORY:$IMAGE_TAG"
119125
docker push "$REGISTRY/$REPOSITORY:$IMAGE_TAG"
120126
121-
# TODO (darora): temporarily also push to prod account from here
127+
# TODO (darora): temporarily also push to prod account from here - add a guard to only publish proper tagged releases to prod?
128+
- name: configure aws credentials - prod
129+
uses: aws-actions/configure-aws-credentials@v4
130+
with:
131+
role-to-assume: ${{ secrets.CONTROL_PLANE_PROD_ROLE }}
132+
aws-region: "us-east-1"
133+
134+
- name: Login to Amazon ECR
135+
id: login-ecr-private
136+
uses: aws-actions/amazon-ecr-login@v2
137+
138+
- name: Push docker image to Amazon ECR
139+
env:
140+
REGISTRY: 156470330064.dkr.ecr.us-east-1.amazonaws.com
141+
REPOSITORY: postgres-vm-image
142+
IMAGE_TAG: ${{ steps.process_release_version.outputs.version }}
143+
run: |
144+
docker tag "postgres:$IMAGE_TAG" "$REGISTRY/$REPOSITORY:$IMAGE_TAG"
145+
docker push "$REGISTRY/$REPOSITORY:$IMAGE_TAG"
122146
123147
- name: Cleanup resources after build
124148
if: ${{ always() }}

0 commit comments

Comments
 (0)