@@ -2,15 +2,8 @@ name: Deploy Backend Services
2
2
3
3
on :
4
4
push :
5
- branches : [ 'main' ]
6
- paths : [
7
- ' services/question/**' ,
8
- ' services/user/**' ,
9
- ' services/match/**' ,
10
- ' services/collaboration/**' ,
11
- ]
5
+ branches : [ 'production' ]
12
6
13
- # Allows you to run this workflow manually from the Actions tab
14
7
workflow_dispatch :
15
8
16
9
permissions :
35
28
- name : Checkout
36
29
uses : actions/checkout@v4
37
30
38
- - name : Check for changes in ${{ matrix.service }} directory
39
- uses : dorny/paths-filter@v3
40
- id : changes
41
- with :
42
- filters : |
43
- service:
44
- - '.services/${{ matrix.service }}/**'
45
-
46
31
- name : Configure AWS credentials
47
32
id : aws-configure
48
- if : steps.changes.output.service == 'true'
49
33
uses :
aws-actions/[email protected]
50
34
with :
51
35
role-to-assume : ${{ secrets.AWS_BACKEND_ROLE }}
@@ -54,12 +38,10 @@ jobs:
54
38
55
39
- name : Login to AWS ECR
56
40
id : login-ecr
57
- if : steps.changes.output.service == 'true'
58
41
uses :
aws-actions/[email protected]
59
42
60
43
- name : Build and push ${{ matrix.service }} image to AWS ECR
61
44
id : build-image
62
- if : steps.changes.output.service == 'true'
63
45
env :
64
46
ECR_REGISTRY : ${{ steps.login-ecr.outputs.registry }}
65
47
ECR_REPOSITORY : ${{ matrix.service }}
71
53
72
54
- name : Update AWS Service (${{ matrix.service }}) # Trigger re-deployment with latest image
73
55
id : update-service
74
- if : steps.changes.output.service == 'true'
75
56
env :
76
57
ECS_SERVICE : ${{ matrix.service }}-service
77
58
run : |
0 commit comments