@@ -69,111 +69,32 @@ jobs:
69
69
aws_ecr_account_id : ${{ needs.context.outputs.aws_ecr_account_id }}
70
70
secrets : inherit
71
71
72
- run-migrations :
73
- name : Run Prisma db migrations
74
- runs-on : ubuntu-latest
75
- needs : [context, build-push-image]
76
- environment : ${{ inputs.environment }}
77
- steps :
78
- - name : Checkout code
79
- uses : actions/checkout@v2
80
- - name : Set up Node
81
- uses : actions/setup-node@v2
82
- with :
83
- node-version : ' 20'
84
- - name : Install dependencies
85
- run : npm ci
86
- - name : Open SSH tunnel
87
- env :
88
- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
89
- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
90
- AWS_REGION : ${{ needs.context.outputs.aws_region }}
91
- run : |
92
- aws ssm start-session \
93
- --target i-0cb09814d228ec31d \
94
- --document-name AWS-StartPortForwardingSessionToRemoteHost \
95
- --parameters host="${{ secrets.JUMPHOST_HOST }}",portNumber="5432",localPortNumber="5432" &
96
- sleep 10
97
- - name : Run migrations
98
- env :
99
- DATABASE_URL : ${{ secrets.DATABASE_URL }}
100
- run : npx prisma migrate deploy
101
-
102
- run-migrations-manual :
103
- name : Run Prisma db migrations
104
- runs-on : ubuntu-latest
105
- needs : [context, build-push-image-manual]
106
- environment : ${{ inputs.environment }}
107
- steps :
108
- - name : Checkout code
109
- uses : actions/checkout@v2
110
- - name : Set up Node
111
- uses : actions/setup-node@v2
112
- with :
113
- node-version : ' 20'
114
- - name : Install dependencies
115
- run : npm ci
116
- - name : Open SSH tunnel
117
- env :
118
- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
119
- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
120
- AWS_REGION : ${{ needs.context.outputs.aws_region }}
121
- run : |
122
- aws ssm start-session \
123
- --target ${{ vars.JUMPHOST_ID }} \
124
- --document-name AWS-StartPortForwardingSessionToRemoteHost \
125
- --parameters host="${{ secrets.JUMPHOST_HOST }}",portNumber="${{ vars.JUMPHOST_PORT }}",localPortNumber="${{ vars.SERVER_PORT }}" &
126
- - name : Run migrations
127
- env :
128
- DATABASE_URL : ${{ secrets.DATABASE_URL }}
129
- run : npx prisma migrate deploy
130
-
131
72
deploy-image :
132
73
if : ${{ github.event_name == 'push' }}
133
74
name : Deploy backend
134
75
uses :
infinum/devops-pipelines/.github/workflows/[email protected]
135
- needs : [context, build-push-image, run-migrations ]
76
+ needs : [context, build-push-image]
136
77
with :
137
78
image_uri : ${{ needs.context.outputs.aws_ecr_uri }}:${{ github.sha }}
138
79
environment : ${{ inputs.environment }}
139
80
aws_region : ${{ needs.context.outputs.aws_region }}
140
81
ecs_cluster : ${{ needs.context.outputs.aws_ecs_cluster }}
141
- ecs_service : js-revisor
82
+ ecs_service : js-react-example
142
83
task_def_path : .aws/ecs/task-definition-app-staging.json
143
- container_name : js-revisor
84
+ container_name : js-react-example
144
85
secrets : inherit
145
86
146
87
deploy-image-manual :
147
88
if : ${{ github.event_name == 'workflow_dispatch' }}
148
89
name : Deploy backend
149
90
uses :
infinum/devops-pipelines/.github/workflows/[email protected]
150
- needs : [context, build-push-image-manual, run-migrations-manual ]
91
+ needs : [context, build-push-image-manual]
151
92
with :
152
93
image_uri : ${{ needs.context.outputs.aws_ecr_uri }}:${{ inputs.custom_tag }}
153
94
environment : ${{ inputs.environment }}
154
95
aws_region : ${{ needs.context.outputs.aws_region }}
155
96
ecs_cluster : ${{ needs.context.outputs.aws_ecs_cluster }}
156
- ecs_service : js-revisor
97
+ ecs_service : js-react-example
157
98
task_def_path : .aws/ecs/task-definition-app-staging.json
158
- container_name : js-revisor
159
- secrets : inherit
160
-
161
- notify-deployment-automatic :
162
- name : Send Slack notification
163
- uses :
infinum/devops-pipelines/.github/workflows/[email protected]
164
- needs :
165
- [
166
- context,
167
- build-push-image,
168
- build-push-image-manual,
169
- run-migrations,
170
- run-migrations-manual,
171
- deploy-image,
172
- deploy-image-manual,
173
- ]
174
- with :
175
- channel : project-js-revisor-notifications
176
- outcome : ${{ needs.build-push-image.result == 'success' || needs.build-push-image-manual.result == 'success'}}
177
- color : ${{ needs.build-push-image.result == 'success' || needs.build-push-image-manual.result == 'success' }}
178
- title : " [Staging] deploy js-revisor: ${{ needs.build-push-image.result == 'success' || needs.build-push-image-manual.result == 'success'}}"
99
+ container_name : js-react-example
179
100
secrets : inherit
0 commit comments