File tree Expand file tree Collapse file tree 1 file changed +23
-6
lines changed
Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -140,11 +140,12 @@ jobs:
140140 command : |
141141 yarn
142142 REACT_APP_CONFIG=<< parameters.config >> yarn build
143+ mv build build_<< parameters.config >>
143144
144145 - persist_to_workspace :
145146 root : /home/circleci/project
146147 paths :
147- - build
148+ - build_<< parameters.config >>
148149
149150 - save_cache : # Store cache in the /go/pkg directory
150151 key : v1-pkg-cache-{{ checksum "yarn.lock" }}
@@ -158,14 +159,21 @@ jobs:
158159 docker :
159160 - image : cimg/python:3.6
160161 parameters :
162+ config :
163+ description : |
164+ The config file you want to build the app using.
165+ E.g. 'development' would load configurations from 'config/development.json'
166+ type : enum
167+ enum : ["development", "staging", "production"]
168+ default : production
161169 bucket :
162170 description : The S3 Bucket to sync files to.
163171 type : string
164172 steps :
165173 - attach_workspace :
166174 at : *workspace
167175 - aws-s3/sync :
168- from : build
176+ from : build_<< parameters.config >>
169177 overwrite : true
170178 to : ' s3://<< parameters.bucket >>'
171179
@@ -181,13 +189,22 @@ workflows:
181189 - checkout_code
182190
183191 - build :
192+ name : build_staging
193+ config : staging
184194 requires :
185- - unit_test
195+ - checkout_code
196+
197+ - build :
198+ name : build_production
199+ config : production
200+ requires :
201+ - checkout_code
186202
187203 - deploy :
188204 name : deploy_staging
205+ config : staging
189206 requires :
190- - build
207+ - build_staging
191208 bucket : <% index .Params `stagingFrontendHost` %>
192209 # Depending on your development flow you may want to also only deploy to staging on master.
193210 # filters:
@@ -198,8 +215,8 @@ workflows:
198215 - deploy :
199216 name : deploy_production
200217 requires :
201- - build
202- - deploy_staging
218+ - unit_test
219+ - build_production
203220 bucket : <% index .Params `productionFrontendHost` %>
204221 filters :
205222 branches :
You can’t perform that action at this time.
0 commit comments