Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 35d28b1

Browse files
Merge pull request #3653 from thibault-deriv/master
Publish to Cloudflare (on push master, on tag production)
2 parents 9da7663 + b5e719b commit 35d28b1

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.circleci/config.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
133153
jobs:
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

174218
workflows:
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

Comments
 (0)