3
3
k8s : circleci/kubernetes@0.7.0
4
4
slack : circleci/slack@3.4.2
5
5
commands :
6
- git_checkout_from_cache :
7
- description : " Git checkout and save cache"
8
- steps :
9
- - restore_cache :
10
- keys :
11
- - source-v1-{{ .Branch }}-{{ .Revision }}
12
- - source-v1-{{ .Branch }}-
13
- - source-v1-
14
- - run :
15
- name : Fetch git tags
16
- command : |
17
- mkdir -p ~/.ssh
18
- ssh-keyscan github.com >> ~/.ssh/known_hosts
19
- echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ' >> ~/.ssh/known_hosts
20
- # Fetch tags if git cache is present
21
- if [ -e /home/circleci/project/.git ]
22
- then
23
- git fetch origin --tags
24
- fi
25
- - checkout
26
- - run :
27
- name : Compress git objects
28
- command : git gc
29
- - save_cache :
30
- key : source-v1-{{ .Branch }}-{{ .Revision }}
31
- paths :
32
- - " .git"
33
6
npm_install :
34
7
description : " npm install and save cache"
35
8
steps :
@@ -60,15 +33,12 @@ commands:
60
33
- run :
61
34
name : Building dist for << parameters.target >>
62
35
command : node_modules/grunt/bin/grunt releaseci --<< parameters.target >>
63
- deploy :
64
- description : " Deploy to static branches "
36
+ versioning :
37
+ description : " Add version to build "
65
38
parameters :
66
39
target_branch :
67
40
type : string
68
41
steps :
69
- - checkout
70
- - attach_workspace :
71
- at : dist
72
42
- run :
73
43
name : Tag build
74
44
command : echo "<< parameters.target_branch >> $(date -u +'%Y-%m-%dT%H:%M:%SZ')" > dist/version
@@ -141,27 +111,29 @@ commands:
141
111
name : " Publish to cloudflare pages (production)"
142
112
command : |
143
113
cd dist
144
- npx wrangler pages publish . --project-name=binary-static-pages --branch=main
114
+ npx wrangler pages publish . --project-name=binary-static-pages --branch=main-test
145
115
echo "New website - http://cf-pages-binary-static.binary.com"
146
116
jobs :
147
117
test :
148
118
docker :
149
119
- image : circleci/node:14-stretch
150
120
steps :
151
- - git_checkout_from_cache
121
+ - checkout
152
122
- npm_install
153
123
- test
154
124
release_staging :
155
125
docker :
156
126
- image : circleci/node:14-stretch
157
127
steps :
158
- - git_checkout_from_cache
128
+ - checkout
159
129
- npm_install
160
130
- test
161
131
- build :
162
132
target : ' staging'
163
133
- build :
164
134
target : ' translations'
135
+ - versioning :
136
+ target_branch : " staging"
165
137
- persist_to_workspace :
166
138
root : dist
167
139
paths :
@@ -175,42 +147,32 @@ jobs:
175
147
docker :
176
148
- image : circleci/node:14-stretch
177
149
steps :
178
- - git_checkout_from_cache
150
+ - checkout
179
151
- npm_install
180
152
- test
181
153
- build :
182
154
target : ' production'
155
+ - versioning :
156
+ target_branch : " production"
183
157
- persist_to_workspace :
184
158
root : dist
185
159
paths :
186
160
- .
187
- - deploy :
188
- target_branch : " production"
189
- - notify_slack
190
- release_aws_production :
191
- docker :
192
- - image : circleci/node:14-stretch
193
- steps :
194
- - git_checkout_from_cache
195
- - npm_install
196
- - test
197
- - build :
198
- target : ' production'
199
161
- docker_build_push :
200
162
docker_latest_image_tag : latest
201
163
docker_image_tag : ${CIRCLE_TAG}
202
164
- k8s_deploy :
203
165
k8s_svc_name : " production-binary-com"
204
166
k8s_namespace : " www-binary-com-production"
205
167
k8s_version : ${CIRCLE_TAG}
168
+ - notify_slack
206
169
publish_cloudflare_staging :
207
170
docker :
208
171
- image : circleci/node:16.13.1-stretch
209
172
steps :
210
173
- attach_workspace :
211
174
at : dist
212
175
- publish_to_pages_staging
213
-
214
176
publish_cloudflare_production :
215
177
docker :
216
178
- image : circleci/node:16.13.1-stretch
@@ -247,13 +209,6 @@ workflows:
247
209
tags :
248
210
only : /^production.*/
249
211
context : binary-frontend-artifact-upload
250
- - release_aws_production :
251
- filters :
252
- branches :
253
- ignore : /.*/
254
- tags :
255
- only : /^production.*/
256
- context : binary-frontend-artifact-upload
257
212
- publish_cloudflare_production :
258
213
requires :
259
214
- release_production
0 commit comments