Skip to content

Commit d577f0b

Browse files
Merge branch 'develop' into snyk-fix-9da7ed0952c6aa8bc8a94cc088b17acc
2 parents 956e540 + b92a8a8 commit d577f0b

File tree

3 files changed

+1552
-1005
lines changed

3 files changed

+1552
-1005
lines changed

.github/workflows/prod-ci-cd.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,26 @@ on:
1414
branches: [main]
1515

1616
jobs:
17+
18+
Publish-Release:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: New Release Publish
22+
id: new_publish
23+
uses: release-drafter/release-drafter@v5
24+
with:
25+
publish : true
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}
28+
29+
outputs:
30+
release_id: ${{ steps.new_publish.outputs.id }}
31+
release_name: ${{ steps.new_publish.outputs.tag_name }}
32+
33+
34+
1735
Deploy-ECS:
36+
needs: Publish-Release
1837
environment: prod
1938
runs-on: ubuntu-latest
2039

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

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

84103
- name: Deploy Amazon ECS task definition
85104
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
@@ -102,10 +121,3 @@ jobs:
102121
method: 'POST'
103122
data: '{"TaskDefinition":${{ steps.taskdefintionvar.outputs.task_definition_arn }},"Name": "${{ secrets.SERVICE_NAME }}","Replicas":1, "HealthCheckGracePeriodSeconds": 1200, "DnsPrfx": ""}'
104123
bearerToken: ${{ secrets.DUPLOCLOUD_TOKEN }}
105-
106-
- name: New Release Publish
107-
uses: release-drafter/release-drafter@v5
108-
with:
109-
publish : true
110-
env:
111-
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}

0 commit comments

Comments
 (0)