@@ -15,32 +15,32 @@ jobs:
1515 strategy :
1616 matrix :
1717 env : [dev, prod, test]
18- name : Build Docker
19- runs-on : ubuntu-latest
20- environment : ${{ matrix.env }}
21- steps :
22- - name : Checkout code
23- uses : actions/checkout@v6
24- with :
25- ref : ${{ github.ref }}
18+ name : Build Docker
19+ runs-on : ubuntu-latest
20+ environment : ${{ matrix.env }}
21+ steps :
22+ - name : Checkout code
23+ uses : actions/checkout@v6
24+ with :
25+ ref : ${{ github.ref }}
2626
27- - name : Configure AWS Credentials
28- uses : aws-actions/configure-aws-credentials@v5
29- with :
30- aws-region : ' ap-southeast-2'
31- role-to-assume : arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/github-nuj-repository-access
32- role-session-name : NujPlatformAPISession
27+ - name : Configure AWS Credentials
28+ uses : aws-actions/configure-aws-credentials@v5
29+ with :
30+ aws-region : ' ap-southeast-2'
31+ role-to-assume : arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/github-nuj-repository-access
32+ role-session-name : NujPlatformAPISession
3333
34- - name : Login to Amazon ECR
35- id : login-ecr
36- uses : aws-actions/amazon-ecr-login@v2
34+ - name : Login to Amazon ECR
35+ id : login-ecr
36+ uses : aws-actions/amazon-ecr-login@v2
3737
38- - name : Build, tag, and push the image to Amazon ECR
39- id : build-image
40- env :
41- ECR_REGISTRY : ${{ steps.login-ecr.outputs.registry }}
42- ECR_REPOSITORY : ' ssh_bastion'
43- IMAGE_TAG : latest
44- run : |
45- docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.sha }} -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.ref_name }} .
46- docker push $ECR_REGISTRY/$ECR_REPOSITORY --all-tags
38+ - name : Build, tag, and push the image to Amazon ECR
39+ id : build-image
40+ env :
41+ ECR_REGISTRY : ${{ steps.login-ecr.outputs.registry }}
42+ ECR_REPOSITORY : ' ssh_bastion'
43+ IMAGE_TAG : latest
44+ run : |
45+ docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.sha }} -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.ref_name }} .
46+ docker push $ECR_REGISTRY/$ECR_REPOSITORY --all-tags
0 commit comments