@@ -2,9 +2,6 @@ name: Create and publish a Docker image
2
2
3
3
on :
4
4
workflow_dispatch :
5
- env :
6
- REGISTRY : ghcr.io
7
- IMAGE_NAME : ${{ github.repository }}
8
5
9
6
jobs :
10
7
build-and-push-image :
@@ -16,15 +13,22 @@ jobs:
16
13
- name : Checkout repository
17
14
uses : actions/checkout@v4
18
15
19
- - name : Log in to the Container registry
20
- uses : docker/login-action@v3
16
+ - name : Configure AWS Credentials
17
+ uses : aws-actions/configure-aws-credentials@v4
21
18
with :
22
- registry : ${{ env.REGISTRY }}
23
- username : ${{ github.actor }}
24
- password : ${{ secrets.GITHUB_TOKEN }}
19
+ role-to-assume : ${{ secrets.E2E_SECRET_TEST_ROLE_ARN }}
20
+ aws-region : us-east-1
25
21
26
- - name : Build and push Docker image
27
- uses : docker/build-push-action@v5
28
- with :
29
- push : true
30
- tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
22
+ - name : Login to Amazon ECR
23
+ id : login-ecr
24
+ uses : aws-actions/amazon-ecr-login@v2
25
+
26
+ - name : Build, tag, and push image to Amazon ECR
27
+ id : build-image
28
+ env :
29
+ ECR_REGISTRY : ${{ steps.login-ecr.outputs.registry }}
30
+ ECR_REPOSITORY : aws-application-signals-test-framework-workflow-container
31
+ IMAGE_TAG : latest
32
+ run : |
33
+ docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
34
+ docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
0 commit comments