|
23 | 23 | options:
|
24 | 24 | - all
|
25 | 25 | - web
|
26 |
| - - good-job |
27 | 26 | - sidekiq
|
28 | 27 | default: all
|
29 | 28 | workflow_call:
|
|
82 | 81 | "application=" + .codedeploy_application_name.value,
|
83 | 82 | "application_group=" + .codedeploy_deployment_group_name.value,
|
84 | 83 | "cluster_name=" + .ecs_variables.value.cluster_name,
|
85 |
| - "good_job_service=" + .ecs_variables.value.good_job.service_name, |
86 |
| - "good_job_task_definition=" + .ecs_variables.value.good_job.task_definition.arn, |
87 | 84 | "sidekiq_service=" + .ecs_variables.value.sidekiq.service_name,
|
88 | 85 | "sidekiq_task_definition=" + .ecs_variables.value.sidekiq.task_definition.arn
|
89 | 86 | ' > ${{ runner.temp }}/DEPLOYMENT_ENVS
|
@@ -126,50 +123,6 @@ jobs:
|
126 | 123 | aws deploy wait deployment-successful --deployment-id "$deployment_id"
|
127 | 124 | echo "Deployment successful"
|
128 | 125 |
|
129 |
| - create-good-job-deployment: |
130 |
| - name: Create good-job deployment |
131 |
| - runs-on: ubuntu-latest |
132 |
| - needs: prepare-deployment |
133 |
| - if: inputs.server_types == 'good-job' || inputs.server_types == 'all' |
134 |
| - permissions: |
135 |
| - id-token: write |
136 |
| - steps: |
137 |
| - - name: Download Artifact |
138 |
| - uses: actions/download-artifact@v5 |
139 |
| - with: |
140 |
| - name: DEPLOYMENT_ENVS-${{ inputs.environment }} |
141 |
| - path: ${{ runner.temp }} |
142 |
| - - name: Configure AWS Credentials |
143 |
| - uses: aws-actions/configure-aws-credentials@v5 |
144 |
| - with: |
145 |
| - role-to-assume: ${{ env.aws-role }} |
146 |
| - aws-region: eu-west-2 |
147 |
| - - name: Trigger ECS Deployment |
148 |
| - run: | |
149 |
| - set -e |
150 |
| - source ${{ runner.temp }}/DEPLOYMENT_ENVS |
151 |
| - DEPLOYMENT_ID=$(aws ecs update-service --cluster $cluster_name --service $good_job_service \ |
152 |
| - --task-definition $good_job_task_definition --force-new-deployment \ |
153 |
| - --query 'service.deployments[?rolloutState==`IN_PROGRESS`].[id][0]' --output text) |
154 |
| - echo "Deployment started: $DEPLOYMENT_ID" |
155 |
| - echo "deployment_id=$DEPLOYMENT_ID" >> $GITHUB_ENV |
156 |
| - - name: Wait for deployment to complete |
157 |
| - run: | |
158 |
| - set -e |
159 |
| - source ${{ runner.temp }}/DEPLOYMENT_ENVS |
160 |
| - DEPLOYMENT_STATE=IN_PROGRESS |
161 |
| - while [ "$DEPLOYMENT_STATE" == "IN_PROGRESS" ]; do |
162 |
| - echo "Waiting for deployment to complete..." |
163 |
| - sleep 30 |
164 |
| - DEPLOYMENT_STATE="$(aws ecs describe-services --cluster $cluster_name --services $good_job_service \ |
165 |
| - --query "services[0].deployments[?id == \`$deployment_id\`].[rolloutState][0]" --output text)" |
166 |
| - done |
167 |
| - if [ "$DEPLOYMENT_STATE" != "COMPLETED" ]; then |
168 |
| - echo "Deployment failed with state: $DEPLOYMENT_STATE" |
169 |
| - exit 1 |
170 |
| - fi |
171 |
| - echo "Deployment successful" |
172 |
| -
|
173 | 126 | create-sidekiq-deployment:
|
174 | 127 | name: Create sidekiq deployment
|
175 | 128 | runs-on: ubuntu-latest
|
|
0 commit comments