Skip to content

Commit

Permalink
Merge pull request #94 from REAN-Foundation/feature/aha_fix
Browse files Browse the repository at this point in the history
Update prod-ci-cd.yml
  • Loading branch information
vinay-debug authored Feb 19, 2024
2 parents ad636d3 + 9b6b062 commit b92a8a8
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/prod-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,26 @@ on:
branches: [main]

jobs:

Publish-Release:
runs-on: ubuntu-latest
steps:
- name: New Release Publish
id: new_publish
uses: release-drafter/release-drafter@v5
with:
publish : true
env:
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}

outputs:
release_id: ${{ steps.new_publish.outputs.id }}
release_name: ${{ steps.new_publish.outputs.tag_name }}



Deploy-ECS:
needs: Publish-Release
environment: prod
runs-on: ubuntu-latest

Expand Down Expand Up @@ -62,7 +81,7 @@ jobs:
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: public.ecr.aws/i9y2d4u3/careplan:${{ steps.vars.outputs.branch }}_${{ steps.vars.outputs.sha_short }}
tags: public.ecr.aws/i9y2d4u3/careplan:${{ needs.Publish-Release.outputs.release_name }}_${{ needs.Publish-Release.outputs.release_id }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

Expand All @@ -79,7 +98,7 @@ jobs:
with:
task-definition: task-definition.json
container-name: default
image: public.ecr.aws/i9y2d4u3/careplan:${{ steps.vars.outputs.branch }}_${{ steps.vars.outputs.sha_short }}
image: public.ecr.aws/i9y2d4u3/careplan:${{ needs.Publish-Release.outputs.release_name }}_${{ needs.Publish-Release.outputs.release_id }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
Expand All @@ -102,10 +121,3 @@ jobs:
method: 'POST'
data: '{"TaskDefinition":${{ steps.taskdefintionvar.outputs.task_definition_arn }},"Name": "${{ secrets.SERVICE_NAME }}","Replicas":1, "HealthCheckGracePeriodSeconds": 1200, "DnsPrfx": ""}'
bearerToken: ${{ secrets.DUPLOCLOUD_TOKEN }}

- name: New Release Publish
uses: release-drafter/release-drafter@v5
with:
publish : true
env:
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}

0 comments on commit b92a8a8

Please sign in to comment.