-
Notifications
You must be signed in to change notification settings - Fork 17
137 lines (135 loc) · 5.83 KB
/
frontend-build.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
name: Frontend build
on: push
jobs:
build:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: frontend
strategy:
matrix:
include:
- env: sandbox1
back_host: https://back.sandbox1.datapass.api.gouv.fr
api_gouv_host: https://staging.api.gouv.fr
piwik_url: ""
piwik_site_id: ""
- env: sandbox2
back_host: https://back.sandbox2.datapass.api.gouv.fr
api_gouv_host: https://staging.api.gouv.fr
piwik_url: ""
piwik_site_id: ""
- env: sandbox3
back_host: https://back.sandbox3.datapass.api.gouv.fr
api_gouv_host: https://staging.api.gouv.fr
piwik_url: ""
piwik_site_id: ""
- env: sandbox4
back_host: https://back.sandbox4.datapass.api.gouv.fr
api_gouv_host: https://staging.api.gouv.fr
piwik_url: ""
piwik_site_id: ""
- env: sandbox5
back_host: https://back.sandbox5.datapass.api.gouv.fr
api_gouv_host: https://staging.api.gouv.fr
piwik_url: ""
piwik_site_id: ""
- env: staging1
back_host: https://back.staging1.datapass.api.gouv.fr
api_gouv_host: https://staging.api.gouv.fr
piwik_url: ""
piwik_site_id: ""
react_app_api_entreprise_redirect_to_v2_host: https://staging.api-entreprise.v2.datapass.api.gouv.fr
- env: staging2
back_host: https://back.staging2.datapass.api.gouv.fr
api_gouv_host: https://staging.api.gouv.fr
piwik_url: ""
piwik_site_id: ""
react_app_api_entreprise_redirect_to_v2_host: https://staging.api-entreprise.v2.datapass.api.gouv.fr
- env: staging3
back_host: https://back.staging3.datapass.api.gouv.fr
api_gouv_host: https://staging.api.gouv.fr
piwik_url: ""
piwik_site_id: ""
react_app_api_entreprise_redirect_to_v2_host: https://staging.api-entreprise.v2.datapass.api.gouv.fr
- env: staging4
back_host: https://back.staging4.datapass.api.gouv.fr
api_gouv_host: https://staging.api.gouv.fr
piwik_url: ""
piwik_site_id: ""
react_app_api_entreprise_redirect_to_v2_host: https://staging.api-entreprise.v2.datapass.api.gouv.fr
- env: staging5
back_host: https://back.staging5.datapass.api.gouv.fr
api_gouv_host: https://staging.api.gouv.fr
piwik_url: ""
piwik_site_id: ""
react_app_api_entreprise_redirect_to_v2_host: https://staging.api-entreprise.v2.datapass.api.gouv.fr
- env: production1
back_host: https://back.datapass.api.gouv.fr
api_gouv_host: https://api.gouv.fr
piwik_url: https://stats.data.gouv.fr
piwik_site_id: "53"
react_app_api_entreprise_redirect_to_v2_host: https://api-entreprise.v2.datapass.api.gouv.fr
- env: production2
back_host: https://back.datapass.api.gouv.fr
api_gouv_host: https://api.gouv.fr
piwik_url: https://stats.data.gouv.fr
piwik_site_id: "53"
react_app_api_entreprise_redirect_to_v2_host: https://api-entreprise.v2.datapass.api.gouv.fr
- env: production3
back_host: https://back.datapass.api.gouv.fr
api_gouv_host: https://api.gouv.fr
piwik_url: https://stats.data.gouv.fr
piwik_site_id: "53"
react_app_api_entreprise_redirect_to_v2_host: https://api-entreprise.v2.datapass.api.gouv.fr
- env: production4
back_host: https://back.datapass.api.gouv.fr
api_gouv_host: https://api.gouv.fr
piwik_url: https://stats.data.gouv.fr
piwik_site_id: "53"
react_app_api_entreprise_redirect_to_v2_host: https://api-entreprise.v2.datapass.api.gouv.fr
- env: production5
back_host: https://back.datapass.api.gouv.fr
api_gouv_host: https://api.gouv.fr
piwik_url: https://stats.data.gouv.fr
piwik_site_id: "53"
react_app_api_entreprise_redirect_to_v2_host: https://api-entreprise.v2.datapass.api.gouv.fr
- env: production
back_host: https://back.datapass.api.gouv.fr
api_gouv_host: https://api.gouv.fr
piwik_url: https://stats.data.gouv.fr
piwik_site_id: "53"
react_app_api_entreprise_redirect_to_v2_host: https://api-entreprise.v2.datapass.api.gouv.fr
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: "16.x"
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- run: npm install
- run: npm run build
env:
REACT_APP_NODE_ENV: production
REACT_APP_BACK_HOST: ${{ matrix.back_host }}
REACT_APP_API_GOUV_HOST: ${{ matrix.api_gouv_host }}
REACT_APP_PIWIK_URL: ${{ matrix.piwik_url }}
REACT_APP_PIWIK_SITE_ID: ${{ matrix.piwik_site_id }}
REACT_APP_API_ENTREPRISE_REDIRECT_TO_V2_HOST: ${{ matrix.react_app_api_entreprise_redirect_to_v2_host }}
- name: Archive build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.env }}-${{ github.sha }}-build
path: |
frontend/build