Skip to content

Commit

Permalink
Merge pull request #2749 from ohcnetwork/vysakh/deploy-update
Browse files Browse the repository at this point in the history
fixed deploy.yml
  • Loading branch information
vigneshhari authored Jan 19, 2025
2 parents 1f26d68 + 88d9b5a commit 6197d83
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ concurrency:
env:
AWS_DEFAULT_REGION: ap-south-1
AWS_DEFAULT_OUTPUT: json
ECS_SERVICE_BACKEND: "care"
ECS_SERVICE_BACKEND: "care-backend"
ECS_SERVICE_CELERY: "care-celery"
ECS_TASK_BACKEND: "care"
ECS_TASK_CELERY: "care-celery"
ECS_CLUSTER: "egov"
CONTAINER_NAME_BACKEND: "care-backend"
CONTAINER_NAME_WORKER: "care-celery-worker"
Expand Down Expand Up @@ -148,33 +150,41 @@ jobs:
- name: Download task definition for Celery Service
run: |
set -e
if aws ecs describe-task-definition --task-definition ${{ env.ECS_SERVICE_CELERY }} --query taskDefinition > celery-task-definition.json; then
if aws ecs describe-task-definition --task-definition ${{ env.ECS_TASK_CELERY }} --query taskDefinition > celery-task-definition.json; then
echo "Successfully downloaded Celery task definition."
else
echo "Failed to download Celery task definition." >&2
exit 1
fi
- name: Fill in the new image ID in the Celery task definition
id: celery-task-def
- name: Fill in the new image ID for the worker container
id: render-worker
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: celery-task-definition.json
container-name: ${{ env.CONTAINER_NAME_WORKER }}
image: ${{ env.IMAGE_VALUE }}

- name: Fill in the new image ID for the cron container
id: render-cron
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ steps.render-worker.outputs.task-definition }}
container-name: ${{ env.CONTAINER_NAME_CRON }}
image: ${{ env.IMAGE_VALUE }}

- name: Deploy Celery task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
with:
task-definition: ${{ steps.celery-task-def.outputs.task-definition }}
task-definition: ${{ steps.render-cron.outputs.task-definition }}
service: ${{ env.ECS_SERVICE_CELERY }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true

- name: Download task definition for Backend Service
run: |
set -e
if aws ecs describe-task-definition --task-definition ${{ env.ECS_SERVICE_BACKEND }} --query taskDefinition > backend-task-definition.json; then
if aws ecs describe-task-definition --task-definition ${{ env.ECS_TASK_BACKEND }} --query taskDefinition > backend-task-definition.json; then
echo "Successfully downloaded Backend task definition."
else
echo "Failed to download Backend task definition." >&2
Expand Down

0 comments on commit 6197d83

Please sign in to comment.