File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,7 +109,6 @@ jobs:
109109 # cache-to: type=gha,mode=max
110110
111111 # Step 4: Build and Deploy to AWS
112- # Step 2: Build and (conditionally) Deploy
113112 build-and-deploy :
114113 name : Build & Deploy to AWS ECS Fargate
115114 runs-on : ubuntu-latest
@@ -130,6 +129,7 @@ jobs:
130129 aws-region : ${{ secrets.AWS_REGION }}
131130
132131 - name : Login to Amazon ECR
132+ id : login-ecr
133133 uses : aws-actions/amazon-ecr-login@v2
134134
135135 - name : Extract metadata
@@ -146,16 +146,11 @@ jobs:
146146 docker build -t $ECR_IMAGE .
147147 echo "ECR_IMAGE=$ECR_IMAGE" >> $GITHUB_ENV
148148
149- # Only push image & deploy when pushing to main
150149 - name : Push image to ECR
151- # Only run on develop branch (For test purposes). To be replaced with main branch when ready.
152- if : github.event_name == 'push' && github.ref == 'refs/heads/develop'
153150 run : |
154151 docker push $ECR_IMAGE
155152
156153 - name : Deploy to Amazon ECS
157- # Only run on develop branch (For test purposes). To be replaced with main branch when ready.
158- if : github.event_name == 'push' && github.ref == 'refs/heads/develop'
159154 run : |
160155 aws ecs update-service \
161156 --cluster ${{ secrets.ECS_CLUSTER_NAME }} \
You can’t perform that action at this time.
0 commit comments