Skip to content

Commit 36a4c05

Browse files
committed
Switch Image Storage to ECR
1 parent 0597099 commit 36a4c05

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

.github/workflows/e2e-test-docker-image-build.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: Create and publish a Docker image
22

33
on:
44
workflow_dispatch:
5-
env:
6-
REGISTRY: ghcr.io
7-
IMAGE_NAME: ${{ github.repository }}
85

96
jobs:
107
build-and-push-image:
@@ -16,15 +13,22 @@ jobs:
1613
- name: Checkout repository
1714
uses: actions/checkout@v4
1815

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
2118
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
2521

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

Comments
 (0)