Skip to content

Commit 7918225

Browse files
authored
Push to ecr prod+staging (#7)
* Push to ecr prod+staging * Update changelog
1 parent 3058aff commit 7918225

File tree

3 files changed

+29
-37
lines changed

3 files changed

+29
-37
lines changed

.github/workflows/docker.yml

-32
This file was deleted.

.github/workflows/ecr.yml

+28-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: |
2424
docker build -t temp:latest -f Dockerfile .
2525
26-
- name: Configure AWS credentials
26+
- name: Configure AWS credentials Prod
2727
uses: aws-actions/configure-aws-credentials@v1.7.0
2828

2929
with:
@@ -32,13 +32,36 @@ jobs:
3232
role-session-name: GitHub_to_AWS_via_FederatedOIDC
3333
aws-region: us-east-1
3434

35-
- name: Login to Amazon ECR
36-
id: login-ecr-management
35+
- name: Login to Amazon ECR Prod
36+
id: login-ecr-management-prod
3737
uses: aws-actions/amazon-ecr-login@v2
3838

39-
- name: Tag and Push Image to Amazon ECR
39+
- name: Tag and Push Image to Amazon ECR Prod
4040
env:
41-
ECR_REGISTRY: ${{ steps.login-ecr-management.outputs.registry }}
41+
ECR_REGISTRY: ${{ steps.login-ecr-management-prod.outputs.registry }}
42+
ECR_REPOSITORY: ml-repository
43+
IMAGE_TAG: scholarag-${{ github.ref_name }}
44+
run: |
45+
docker tag temp:latest $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
46+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
47+
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG temp:latest
48+
49+
- name: Configure AWS credentials Staging
50+
uses: aws-actions/configure-aws-credentials@v1.7.0
51+
52+
with:
53+
role-to-assume: arn:aws:iam::992382665735:role/GitHub2ECR # check terraform output
54+
55+
role-session-name: GitHub_to_AWS_via_FederatedOIDC
56+
aws-region: us-east-1
57+
58+
- name: Login to Amazon ECR Staging
59+
id: login-ecr-management-staging
60+
uses: aws-actions/amazon-ecr-login@v2
61+
62+
- name: Tag and Push Image to Amazon ECR Staging
63+
env:
64+
ECR_REGISTRY: ${{ steps.login-ecr-management-staging.outputs.registry }}
4265
ECR_REPOSITORY: ml-repository
4366
IMAGE_TAG: scholarag-${{ github.ref_name }}
4467
run: |

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
### Fixed
1414
- Limit query size.
1515
- Add OBI copyright.
16+
- Push to ECR prod+staging.
1617

1718
## [0.0.8] - 10.12.2024
1819

0 commit comments

Comments
 (0)