@@ -130,6 +130,26 @@ commands:
130130 failure_message : " Release failed for binary bot with version *$(cat www/version)*"
131131 success_message : " Release succeeded for binary bot with version *$(cat www/version)*"
132132 webhook : ${SLACK_WEBHOOK}
133+
134+
135+ publish_to_pages_staging :
136+ description : " Publish to cloudflare pages"
137+ steps :
138+ - run :
139+ name : " Publish to cloudflare pages (staging)"
140+ command : |
141+ npx wrangler pages publish www/ --project-name=binary-bot-pages --branch=staging
142+ echo "New staging website - http://staging.cf-pages-binary-bot.deriv.com"
143+
144+ publish_to_pages_production :
145+ description : " Publish to cloudflare pages"
146+ steps :
147+ - run :
148+ name : " Publish to cloudflare pages (production)"
149+ command : |
150+ npx wrangler pages publish www/ --project-name=binary-bot-pages --branch=main
151+ echo "New website - http://cf-pages-binary-bot.deriv.com"
152+
133153jobs :
134154 test :
135155 docker :
@@ -147,6 +167,10 @@ jobs:
147167 - npm_install
148168 - test
149169 - build
170+ - persist_to_workspace :
171+ root : www
172+ paths :
173+ - .
150174 - docker_build_push
151175 - deploy :
152176 target_branch : " staging"
@@ -160,6 +184,10 @@ jobs:
160184 - npm_install
161185 - test
162186 - build
187+ - persist_to_workspace :
188+ root : www
189+ paths :
190+ - .
163191 - docker_build_push :
164192 docker_latest_image_tag : latest
165193 docker_image_tag : ${CIRCLE_TAG}
@@ -170,6 +198,22 @@ jobs:
170198 k8s_namespace : " bot-binary-com-production"
171199 k8s_version : ${CIRCLE_TAG}
172200 - notify_slack
201+
202+ publish_cloudflare_staging :
203+ docker :
204+ - image : circleci/node:16.13.1-stretch
205+ steps :
206+ - attach_workspace :
207+ at : www
208+ - publish_to_pages_staging
209+
210+ publish_cloudflare_production :
211+ docker :
212+ - image : circleci/node:16.13.1-stretch
213+ steps :
214+ - attach_workspace :
215+ at : www
216+ - publish_to_pages_production
173217
174218workflows :
175219 test :
@@ -184,10 +228,26 @@ workflows:
184228 filters :
185229 branches :
186230 only : /^master$/
231+ - publish_cloudflare_staging :
232+ requires :
233+ - release_staging
234+ filters :
235+ branches :
236+ only : /^master$/
237+ context : binary-frontend-artifact-upload
187238 - release_production :
188239 filters :
189240 branches :
190241 ignore : /.*/
191242 tags :
192243 only : /^production.*/
193244 context : binary-frontend-artifact-upload
245+ - publish_cloudflare_production :
246+ requires :
247+ - release_production
248+ filters :
249+ branches :
250+ ignore : /.*/
251+ tags :
252+ only : /^production.*/
253+ context : binary-frontend-artifact-upload
0 commit comments