-
Notifications
You must be signed in to change notification settings - Fork 12
205 lines (174 loc) · 7.23 KB
/
develop-1.1.0-aws-amplify-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Aws-Amplify-Build-Develop-1.1.0
on:
push:
branches:
- develop-1.1.0
paths:
- 'apps/taxi-bpp-v2/**'
- 'apps/retail/**'
- 'apps/mobility-bap/**'
- 'apps/policy-admin/**'
- 'apps/tourismV1.1/**'
- 'apps/dsep/**'
- 'apps/industry_4.0/**'
- 'apps/odr-v2/**'
- 'apps/dsnp-v2/**'
- 'apps/OSC/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2
# taxi-bpp-v2
- name: Check for taxi-bpp-v2 changes
id: check_taxi_bpp_changes
run: |
if git diff --name-only HEAD~1 HEAD | grep '^apps/taxi-bpp-v2/'; then
echo "Changes in taxi-bpp-v2 detected."
echo "taxi_bpp_changed=true" >> $GITHUB_ENV
else
echo "No changes in taxi-bpp-v2. Skipping webhook trigger."
echo "taxi_bpp_changed=false" >> $GITHUB_ENV
fi
- name: Trigger taxi-bpp-v2 deployment if changes are detected
if: env.taxi_bpp_changed == 'true'
run: |
curl -X POST -d {} "${{ secrets.TAXI_BPP_DEVELOP_AMPLIFY_WEBHOOK_URL }}" -H "Content-Type:application/json"
# retail
- name: Check for retail changes
id: check_retail_changes
run: |
if git diff --name-only HEAD~1 HEAD | grep '^apps/retail/'; then
echo "Changes in retail detected."
echo "retail_changed=true" >> $GITHUB_ENV
else
echo "No changes in retail. Skipping webhook trigger."
echo "retail_changed=false" >> $GITHUB_ENV
fi
- name: Trigger retail deployment if changes are detected
if: env.retail_changed == 'true'
run: |
curl -X POST -d {} "${{ secrets.RETAIL_DEVELOP_AMPLIFY_WEBHOOK_URL }}" -H "Content-Type:application/json"
# mobility-bap
- name: Check for mobility-bap changes
id: check_mobility_bap_changes
run: |
if git diff --name-only HEAD~1 HEAD | grep '^apps/mobility-bap/'; then
echo "Changes in mobility-bap detected."
echo "mobility_bap_changed=true" >> $GITHUB_ENV
else
echo "No changes in mobility-bap. Skipping webhook trigger."
echo "mobility_bap_changed=false" >> $GITHUB_ENV
fi
- name: Trigger mobility-bap deployment if changes are detected
if: env.mobility_bap_changed == 'true'
run: |
curl -X POST -d {} "${{ secrets.MOBILITY_BAP_DEVELOP_AMPLIFY_WEBHOOK_URL }}" -H "Content-Type:application/json"
# policy-admin
- name: Check for policy admin changes
id: check_policy_admin_changes
run: |
if git diff --name-only HEAD~1 HEAD | grep '^apps/policy_admin/'; then
echo "Changes in policy admin detected."
echo "policy_admin_changed=true" >> $GITHUB_ENV
else
echo "No changes in policy admin. Skipping webhook trigger."
echo "policy_admin_changed=false" >> $GITHUB_ENV
fi
- name: Trigger policy admin deployment if changes are detected
if: env.policy_admin_changed == 'true'
run: |
curl -X POST -d {} "${{ secrets.POLICY_ADMIN_DEVELOP_AMPLIFY_WEBHOOK_URL }}" -H "Content-Type:application/json"
# tourismv1.1
- name: Check for tourismV1.1 changes
id: check_tourism_v1_1_changes
run: |
if git diff --name-only HEAD~1 HEAD | grep '^apps/tourismV1.1/'; then
echo "Changes in tourismV1.1 detected."
echo "tourism_v1_1_changed=true" >> $GITHUB_ENV
else
echo "No changes in tourismV1.1. Skipping webhook trigger."
echo "tourism_v1_1_changed=false" >> $GITHUB_ENV
fi
- name: Trigger tourismV1.1 deployment if changes are detected
if: env.tourism_v1_1_changed == 'true'
run: |
curl -X POST -d {} "${{ secrets.TOURISM_V1_1_DEVELOP_AMPLIFY_WEBHOOK_URL }}" -H "Content-Type:application/json"
# dsep
- name: Check for dsep changes
id: check_dsep_changes
run: |
if git diff --name-only HEAD~1 HEAD | grep '^apps/dsep/'; then
echo "Changes in dsep detected."
echo "dsep_changed=true" >> $GITHUB_ENV
else
echo "No changes in dsep. Skipping webhook trigger."
echo "dsep_changed=false" >> $GITHUB_ENV
fi
- name: Trigger dsep deployment if changes are detected
if: env.dsep_changed == 'true'
run: |
curl -X POST -d {} "${{ secrets.DSEP_DEVELOP_AMPLIFY_WEBHOOK_URL }}" -H "Content-Type:application/json"
# industry-4.0
- name: Check for industry_4.0 changes
id: check_industry_4_0_changes
run: |
if git diff --name-only HEAD~1 HEAD | grep '^apps/industry_4.0/'; then
echo "Changes in industry_4.0 detected."
echo "industry_4_0_changed=true" >> $GITHUB_ENV
else
echo "No changes in industry_4.0. Skipping webhook trigger."
echo "industry_4_0_changed=false" >> $GITHUB_ENV
fi
- name: Trigger industry_4.0 deployment if changes are detected
if: env.industry_4_0_changed == 'true'
run: |
curl -X POST -d {} "${{ secrets.INDUSTRY_4_0_DEVELOP_AMPLIFY_WEBHOOK_URL }}" -H "Content-Type:application/json"
# odr-v2
- name: Check for odr-v2 changes
id: check_odr_v2_changes
run: |
if git diff --name-only HEAD~1 HEAD | grep '^apps/odr-v2/'; then
echo "Changes in odr-v2 detected."
echo "odr_v2_changed=true" >> $GITHUB_ENV
else
echo "No changes in odr-v2. Skipping webhook trigger."
echo "odr_v2_changed=false" >> $GITHUB_ENV
fi
- name: Trigger odr-v2 deployment if changes are detected
if: env.odr_v2_changed == 'true'
run: |
curl -X POST -d {} "${{ secrets.ODR_V2_DEVELOP_AMPLIFY_WEBHOOK_URL }}" -H "Content-Type:application/json"
# dsnp-v2
- name: Check for dsnp-v2 changes
id: check_dsnp_v2_changes
run: |
if git diff --name-only HEAD~1 HEAD | grep '^apps/dsnp-v2/'; then
echo "Changes in dsnp-v2 detected."
echo "dsnp_v2_changed=true" >> $GITHUB_ENV
else
echo "No changes in dsnp-v2. Skipping webhook trigger."
echo "dsnp_v2_changed=false" >> $GITHUB_ENV
fi
- name: Trigger dsnp-v2 deployment if changes are detected
if: env.dsnp_v2_changed == 'true'
run: |
curl -X POST -d {} "${{ secrets.DSNP_V2_DEVELOP_AMPLIFY_WEBHOOK_URL }}" -H "Content-Type:application/json"
# retail-osc
- name: Check for OSC changes
id: check_osc_changes
run: |
if git diff --name-only HEAD~1 HEAD | grep '^apps/OSC/'; then
echo "Changes in OSC detected."
echo "osc_changed=true" >> $GITHUB_ENV
else
echo "No changes in OSC. Skipping webhook trigger."
echo "osc_changed=false" >> $GITHUB_ENV
fi
- name: Trigger OSC deployment if changes are detected
if: env.osc_changed == 'true'
run: |
curl -X POST -d {} "${{ secrets.OSC_DEVELOP_AMPLIFY_WEBHOOK_URL }}" -H "Content-Type:application/json"