1
+ # This workflow will build and the traffic generator image to each region whenever there is an update made to the traffic-generator folder.
2
+ # This image will be used by EKS and K8s test to call sample app endpoints
3
+ name : Create and Push Traffic Generator Image
4
+
5
+ on :
6
+ workflow_dispatch :
7
+ push :
8
+ # branches:
9
+ # - main
10
+ # paths:
11
+ # - 'traffic-generator/**'
12
+
13
+ permissions :
14
+ id-token : write
15
+ contents : read
16
+
17
+ jobs :
18
+ build-and-push-image :
19
+ runs-on : ubuntu-latest
20
+ strategy :
21
+ matrix :
22
+ aws-region : ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1',
23
+ ' ap-southeast-2' ,'ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1',
24
+ ' eu-south-1' ,'eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1',
25
+ ' us-east-1' ,'us-east-2','us-west-1','us-west-2']
26
+ steps :
27
+ - name : Checkout repository
28
+ uses : actions/checkout@v4
29
+
30
+ - name : Configure AWS Credentials
31
+ uses : aws-actions/configure-aws-credentials@v4
32
+ with :
33
+ role-to-assume : ${{ secrets.E2E_SECRET_TEST_ROLE_ARN }}
34
+ aws-region : us-east-1
35
+
36
+ - name : Retrieve account
37
+ uses : aws-actions/aws-secretsmanager-get-secrets@v1
38
+ with :
39
+ secret-ids : |
40
+ ACCOUNT_ID, region-account/${{ matrix.aws-region }}
41
+
42
+ - name : Configure AWS Credentials
43
+ uses : aws-actions/configure-aws-credentials@v4
44
+ with :
45
+ role-to-assume : arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
46
+ aws-region : ${{ matrix.aws-region }}
47
+
48
+ - name : Login to Amazon ECR
49
+ id : login-ecr
50
+ uses : aws-actions/amazon-ecr-login@v2
51
+
52
+ - name : Build, tag, and push image to Amazon ECR
53
+ working-directory : traffic-generator
54
+ env :
55
+ REGISTRY : ${{ steps.login-ecr.outputs.registry }}
56
+ REPOSITORY : e2e-test-resource
57
+ IMAGE_TAG : traffic-generator
58
+ run : |
59
+ docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
60
+ docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
0 commit comments