11name : |-
22 CD - Deploy to ECS QA/Preview envs with Ecspresso
3-
3+
44 Deploy Docker image to ECS QA/Preview envs with Ecspresso
5-
5+
66 ### Usage
7-
7+
88 ```yaml
99 name: Feature Branch
1010 on:
1111 pull_request:
1212 branches: [ 'main' ]
1313 types: [opened, synchronize, reopened, closed, labeled, unlabeled]
14-
14+
1515 jobs:
1616 cd:
1717 uses: ./.github/workflows/workflow-cd-preview-ecspresso.yml
8989 type : boolean
9090 required : false
9191 default : false
92+ use-partial-taskdefinition :
93+ description : " Use partial task definition (ecspresso)"
94+ type : boolean
95+ required : false
96+ default : true
97+ deploy-timeout :
98+ description : " Timeout for ecspresso deploy step (e.g., 10m, 30m)"
99+ type : string
100+ required : false
101+ default : 15m
92102 matrix-step-name :
93103 description : " Matrix step name - matrix output workaround. [Read more](https://github.com/cloudposse/github-action-matrix-outputs-write#introduction)"
94104 required : false
@@ -139,7 +149,7 @@ jobs:
139149 environment :
140150 name : ${{ matrix.env }}
141151 url : ${{ steps.result.outputs.webapp-url }}
142- needs : [ preview ]
152+ needs : [preview]
143153 steps :
144154 -
uses :
cloudposse/[email protected] 145155 id : image
@@ -166,8 +176,8 @@ jobs:
166176 with :
167177 output_properties : true
168178 patterns : |
169- - .github/configs/environment.yaml
170-
179+ - .github/configs/environment.yaml
180+
171181 - name : Environment Info
172182 uses :
cloudposse/[email protected] 173183 id : environment
@@ -203,7 +213,7 @@ jobs:
203213 application : ${{ steps.environment.outputs.name }}
204214 taskdef-path : ${{ inputs.path }}
205215 mirror_to_s3_bucket : ${{ steps.environment.outputs.s3-bucket }}
206- use_partial_taskdefinition : ' true '
216+ use_partial_taskdefinition : ${{ inputs.use-partial-taskdefinition || '' }}
207217 overrides : |-
208218 {
209219 "containerOverrides":[
@@ -217,8 +227,8 @@ jobs:
217227 ]
218228 }
219229 env :
220- STAGE : ${{ steps.environment.outputs.stage }}
221- AWS_ACCOUNT_ID : ${{ steps.environment.outputs.account-id }}
230+ STAGE : ${{ steps.environment.outputs.stage }}
231+ AWS_ACCOUNT_ID : ${{ steps.environment.outputs.account-id }}
222232 ECS_SERVICE_NAME : ${{ steps.environment.outputs.name }}
223233 ECS_SERVICE_TASK_ROLE : ${{ steps.environment.outputs.role }}-task
224234 ECS_SERVICE_EXECUTION_ROLE : ${{ steps.environment.outputs.role }}-exec
@@ -238,11 +248,11 @@ jobs:
238248 application : ${{ steps.environment.outputs.name }}
239249 taskdef-path : ${{ inputs.path }}
240250 mirror_to_s3_bucket : ${{ steps.environment.outputs.s3-bucket }}
241- use_partial_taskdefinition : ' true '
242- timeout : 15m
251+ use_partial_taskdefinition : ${{ inputs.use-partial-taskdefinition || '' }}
252+ timeout : ${{ inputs.deploy-timeout }}
243253 env :
244- STAGE : ${{ steps.environment.outputs.stage }}
245- AWS_ACCOUNT_ID : ${{ steps.environment.outputs.account-id }}
254+ STAGE : ${{ steps.environment.outputs.stage }}
255+ AWS_ACCOUNT_ID : ${{ steps.environment.outputs.account-id }}
246256 ECS_SERVICE_NAME : ${{ steps.environment.outputs.name }}
247257 ECS_SERVICE_TASK_ROLE : ${{ steps.environment.outputs.role }}-task
248258 ECS_SERVICE_EXECUTION_ROLE : ${{ steps.environment.outputs.role }}-exec
@@ -272,8 +282,8 @@ jobs:
272282 ]
273283 }
274284 env :
275- STAGE : ${{ steps.environment.outputs.stage }}
276- AWS_ACCOUNT_ID : ${{ steps.environment.outputs.account-id }}
285+ STAGE : ${{ steps.environment.outputs.stage }}
286+ AWS_ACCOUNT_ID : ${{ steps.environment.outputs.account-id }}
277287 ECS_SERVICE_NAME : ${{ steps.environment.outputs.name }}
278288 ECS_SERVICE_TASK_ROLE : ${{ steps.environment.outputs.role }}-task
279289 ECS_SERVICE_EXECUTION_ROLE : ${{ steps.environment.outputs.role }}-exec
@@ -302,7 +312,7 @@ jobs:
302312 strategy :
303313 matrix :
304314 env : ${{ fromJson(needs.preview.outputs.destroy_envs) }}
305- needs : [ preview ]
315+ needs : [preview]
306316 steps :
307317 -
uses :
cloudposse/[email protected] 308318 id : image
@@ -337,7 +347,7 @@ jobs:
337347 with :
338348 output_properties : true
339349 patterns : |
340- - .github/configs/environment.yaml
350+ - .github/configs/environment.yaml
341351
342352 - name : Environment Info
343353 uses :
cloudposse/[email protected] @@ -385,8 +395,8 @@ jobs:
385395 ]
386396 }
387397 env :
388- STAGE : ${{ steps.environment.outputs.stage }}
389- AWS_ACCOUNT_ID : ${{ steps.environment.outputs.account-id }}
398+ STAGE : ${{ steps.environment.outputs.stage }}
399+ AWS_ACCOUNT_ID : ${{ steps.environment.outputs.account-id }}
390400 ECS_SERVICE_NAME : ${{ steps.environment.outputs.name }}
391401 ECS_SERVICE_TASK_ROLE : ${{ steps.environment.outputs.role }}-task
392402 ECS_SERVICE_EXECUTION_ROLE : ${{ steps.environment.outputs.role }}-exec
0 commit comments