-
Notifications
You must be signed in to change notification settings - Fork 5
195 lines (180 loc) · 7.56 KB
/
npm-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
name: Deploy Web OC test applications.
#
# To add a new deployment target, you need to:
# 1. Add a new repository secret with the name of the deployment target and the value of the Azure Static Web Apps API token.
# 2. Add a new repository varaibel with the name of the deployment target and the value of the app-config.json file in base64 format.
#
on:
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18
- run: npm ci
- name: Run unit tests
run: npm run test
- name: Build distribution
run: npm run build
- name: Create the staticwebapp.config.json file
run: |
cat > dist/staticwebapp.config.json <<EOL
{
"navigationFallback": {
"rewrite": "index.html"
}
}
EOL
touch dist/app-config.json
shell: bash
- name: Overwrite the app-config.json file for IWP Public App
run: |
rm dist/app-config.json
echo "${{ vars.IWP_PUBLIC_APP_CONFIG_JSON_BASE64 }}" | base64 --decode > dist/app-config.json
shell: bash
- name: Deploy Azure Static Web Apps IWP Public App
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9
with:
action: 'upload'
app_location: '/dist'
api_location: ''
skip_app_build: true
azure_static_web_apps_api_token: ${{ secrets.IWP_PUBLIC_APP_AZURE_STATIC_WEB_APP_TOKEN }}
- name: Overwrite the app-config.json file for IWP Secured App
run: |
rm dist/app-config.json
echo "${{ vars.IWP_SECURED_APP_CONFIG_JSON_BASE64 }}" | base64 --decode > dist/app-config.json
shell: bash
- name: Deploy Azure Static Web Apps IWP Public App
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9
with:
action: 'upload'
app_location: '/dist'
api_location: ''
skip_app_build: true
verbose: 'true'
azure_static_web_apps_api_token: ${{ secrets.IWP_SECURED_APP_AZURE_STATIC_WEB_APP_TOKEN }}
- name: Overwrite the app-config.json file for BOM App
run: |
rm dist/app-config.json
echo "${{ vars.BOM_APP_CONFIG_JSON_BASE64 }}" | base64 --decode > dist/app-config.json
shell: bash
- name: Deploy Azure Static Web Apps BOM App
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9
with:
action: 'upload'
app_location: '/dist'
api_location: ''
skip_app_build: true
azure_static_web_apps_api_token: ${{ secrets.BOM_APP_AZURE_STATIC_WEB_APP_TOKEN }}
- name: Overwrite the app-config.json file for SAVA App
run: |
rm dist/app-config.json
echo "${{ vars.SAVA_APP_CONFIG_JSON_BASE64 }}" | base64 --decode > dist/app-config.json
shell: bash
- name: Deploy Azure Static Web Apps SAVA App
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9
with:
action: 'upload'
app_location: '/dist'
api_location: ''
skip_app_build: true
azure_static_web_apps_api_token: ${{ secrets.SAVA_APP_AZURE_STATIC_WEB_APP_TOKEN }}
- name: Create app-config.json file for GLOSSIS App
run: |
rm dist/app-config.json
echo "${{ vars.GLOSSIS_APP_CONFIG_JSON_BASE64 }}" | base64 --decode > dist/app-config.json
shell: bash
- name: Deploy Azure Static Web Apps GLOSSIS App
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9
with:
action: 'upload'
app_location: '/dist'
api_location: ''
skip_app_build: true
azure_static_web_apps_api_token: ${{ secrets.GLOSSIS_APP_AZURE_STATIC_WEB_APP_TOKEN }}
- name: Create app-config.json file for Noordzee Secured App
run: |
rm dist/app-config.json
echo "${{ vars.NOORDZEE_APP_CONFIG_JSON_BASE64 }}" | base64 --decode > dist/app-config.json
shell: bash
- name: Deploy Azure Static Web Apps Noordzee App
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9
with:
action: 'upload'
app_location: '/dist'
api_location: ''
skip_app_build: true
azure_static_web_apps_api_token: ${{ secrets.NOORDZEE_APP_AZURE_STATIC_WEB_APP_TOKEN }}
- name: Create the app-config.json file for Durban App
run: |
rm dist/app-config.json
echo "${{ vars.DURBAN_APP_CONFIG_JSON_BASE64 }}" | base64 --decode > dist/app-config.json
shell: bash
- name: Deploy Azure Static Web Apps Durban App
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9
with:
action: 'upload'
app_location: '/dist'
api_location: ''
skip_app_build: true
azure_static_web_apps_api_token: ${{ secrets.DURBAN_APP_AZURE_STATIC_WEB_APP_TOKEN }}
- name: Create the app-config.json file for Navy App
run: |
rm dist/app-config.json
echo "${{ vars.NAVY_APP_CONFIG_JSON_BASE64 }}" | base64 --decode > dist/app-config.json
shell: bash
- name: Deploy Azure Static Web Apps Navy App
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9
with:
action: 'upload'
app_location: '/dist'
api_location: ''
skip_app_build: true
azure_static_web_apps_api_token: ${{ secrets.NAVY_APP_AZURE_STATIC_WEB_APP_TOKEN }}
- name: Create the app-config.json file for Volvo Ocean Race App
run: |
rm dist/app-config.json
echo "${{ vars.VOLVO_OCEAN_RACE_APP_CONFIG_JSON_BASE64 }}" | base64 --decode > dist/app-config.json
shell: bash
- name: Deploy Azure Static Web Apps Volvo Ocean Race App
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9
with:
action: 'upload'
app_location: '/dist'
api_location: ''
skip_app_build: true
azure_static_web_apps_api_token: ${{ secrets.VOLVO_OCEAN_RACE_APP_AZURE_STATIC_WEB_APP_TOKEN }}
- name: Create the app-config.json file for Trend Hyd App
run: |
rm dist/app-config.json
echo "${{ vars.TREND_HYD_APP_CONFIG_JSON_BASE64 }}" | base64 --decode > dist/app-config.json
shell: bash
- name: Deploy Azure Static Web Apps Trend Hyd
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9
with:
action: 'upload'
app_location: '/dist'
api_location: ''
skip_app_build: true
azure_static_web_apps_api_token: ${{ secrets.TREND_HYD_APP_AZURE_STATIC_WEB_APP_TOKEN }}
- name: Create the app-config.json file for IWP SWM App
run: |
rm dist/app-config.json
echo "${{ vars.IWP_SWM_APP_CONFIG_JSON_BASE64 }}" | base64 --decode > dist/app-config.json
shell: bash
- name: Deploy Azure Static Web Apps IWP SWM
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9
with:
action: 'upload'
app_location: '/dist'
api_location: ''
skip_app_build: true
azure_static_web_apps_api_token: ${{ secrets.IWP_SWM_APP_AZURE_STATIC_WEB_APP_TOKEN }}