diff --git a/.github/workflows/aws_deploy.yml b/.github/workflows/aws_deploy.yml index 659c7f75a..bd258ce8e 100644 --- a/.github/workflows/aws_deploy.yml +++ b/.github/workflows/aws_deploy.yml @@ -117,7 +117,7 @@ jobs: env: ad_hoc_task_definition: ${{ inputs.aws_resource_prefix }}-ad-hoc cluster: ${{ inputs.aws_resource_prefix }} - service: ${{ inputs.aws_resource_prefix }} + service: ${{ inputs.aws_resource_prefix }}-app run: | network=$(aws ecs describe-services --cluster $cluster --services $service --query services[0].networkConfiguration) overrides='{ "containerOverrides" : [{ "name" : "app", "command" : ["bundle", "exec", "rake", "db:migrate"]}]}' @@ -129,13 +129,13 @@ jobs: succeeded=$(aws ecs describe-tasks --cluster $cluster --tasks $id --query "tasks[0].stopCode == 'EssentialContainerExited' && to_string(tasks[0].containers[0].exitCode) == '0'") if [ $succeeded == true ]; then exit 0; else exit 1; fi - - name: Download service task definition + - name: Download app service task definition env: app_task_definition: ${{ inputs.aws_resource_prefix }}-app run: | aws ecs describe-task-definition --task-definition $app_task_definition --query taskDefinition > app-task-definition.json - - name: Update image ID + - name: Update app image ID id: app-task-def uses: aws-actions/amazon-ecs-render-task-definition@v1 with: @@ -147,6 +147,28 @@ jobs: uses: aws-actions/amazon-ecs-deploy-task-definition@v1 with: cluster: ${{ inputs.aws_resource_prefix }} - service: ${{ inputs.aws_resource_prefix }} + service: ${{ inputs.aws_resource_prefix }}-app task-definition: ${{ steps.app-task-def.outputs.task-definition }} wait-for-service-stability: true + + - name: Download sidekiq service task definition + env: + sidekiq_task_definition: ${{ inputs.aws_resource_prefix }}-sidekiq + run: | + aws ecs describe-task-definition --task-definition $sidekiq_task_definition --query taskDefinition > sidekiq-task-definition.json + + - name: Update sidekiq image ID + id: sidekiq-task-def + uses: aws-actions/amazon-ecs-render-task-definition@v1 + with: + task-definition: sidekiq-task-definition.json + container-name: sidekiq + image: ${{ env.image }} + + - name: Deploy updated sidekiq + uses: aws-actions/amazon-ecs-deploy-task-definition@v1 + with: + cluster: ${{ inputs.aws_resource_prefix }} + service: ${{ inputs.aws_resource_prefix }}-sidekiq + task-definition: ${{ steps.sidekiq-task-def.outputs.task-definition }} + wait-for-service-stability: true