@@ -124,6 +124,25 @@ commands:
124124 failure_message : " Release failed for Binary.com with version *$(cat dist/version)*"
125125 success_message : " Release succeeded for Binary.com with version *$(cat dist/version)*"
126126 webhook : ${SLACK_WEBHOOK}
127+ publish_to_pages_staging :
128+ description : " Publish to cloudflare pages"
129+ steps :
130+ - run :
131+ name : " Publish to cloudflare pages (staging)"
132+ command : |
133+ cd dist
134+ npx wrangler pages publish . --project-name=binary-static-pages --branch=staging
135+ echo "New staging website - http://staging.cf-pages-binary-static.deriv.com"
136+
137+ publish_to_pages_production :
138+ description : " Publish to cloudflare pages"
139+ steps :
140+ - run :
141+ name : " Publish to cloudflare pages (production)"
142+ command : |
143+ cd dist
144+ npx wrangler pages publish . --project-name=binary-static-pages --branch=main
145+ echo "New website - http://cf-pages-binary-static.deriv.com"
127146jobs :
128147 test :
129148 docker :
@@ -143,6 +162,10 @@ jobs:
143162 target : ' staging'
144163 - build :
145164 target : ' translations'
165+ - persist_to_workspace :
166+ root : dist
167+ paths :
168+ - .
146169 - deploy :
147170 target_branch : " staging"
148171 - docker_build_push
@@ -157,6 +180,10 @@ jobs:
157180 - test
158181 - build :
159182 target : ' production'
183+ - persist_to_workspace :
184+ root : dist
185+ paths :
186+ - .
160187 - deploy :
161188 target_branch : " production"
162189 - notify_slack
@@ -176,6 +203,22 @@ jobs:
176203 k8s_svc_name : " production-binary-com"
177204 k8s_namespace : " www-binary-com-production"
178205 k8s_version : ${CIRCLE_TAG}
206+ publish_cloudflare_staging :
207+ docker :
208+ - image : circleci/node:16.13.1-stretch
209+ steps :
210+ - attach_workspace :
211+ at : dist
212+ - publish_to_pages_staging
213+
214+ publish_cloudflare_production :
215+ docker :
216+ - image : circleci/node:16.13.1-stretch
217+ steps :
218+ - attach_workspace :
219+ at : dist
220+ - publish_to_pages_production
221+
179222workflows :
180223 test :
181224 jobs :
@@ -189,6 +232,13 @@ workflows:
189232 filters :
190233 branches :
191234 only : /^master$/
235+ - publish_cloudflare_staging :
236+ requires :
237+ - release_staging
238+ filters :
239+ branches :
240+ only : /^master$/
241+ context : binary-frontend-artifact-upload
192242 - release_production :
193243 filters :
194244 branches :
@@ -202,3 +252,12 @@ workflows:
202252 tags :
203253 only : /^production.*/
204254 context : binary-frontend-artifact-upload
255+ - publish_cloudflare_production :
256+ requires :
257+ - release_aws_production
258+ filters :
259+ branches :
260+ ignore : /.*/
261+ tags :
262+ only : /^production.*/
263+ context : binary-frontend-artifact-upload
0 commit comments