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

Commit 5047e73

Browse files
Clean CI
1 parent d343af0 commit 5047e73

File tree

1 file changed

+11
-56
lines changed

1 file changed

+11
-56
lines changed

.circleci/config.yml

Lines changed: 11 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,6 @@ orbs:
33
k8s: circleci/kubernetes@0.7.0
44
slack: circleci/slack@3.4.2
55
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"
336
npm_install:
347
description: "npm install and save cache"
358
steps:
@@ -60,15 +33,12 @@ commands:
6033
- run:
6134
name: Building dist for << parameters.target >>
6235
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"
6538
parameters:
6639
target_branch:
6740
type: string
6841
steps:
69-
- checkout
70-
- attach_workspace:
71-
at: dist
7242
- run:
7343
name: Tag build
7444
command: echo "<< parameters.target_branch >> $(date -u +'%Y-%m-%dT%H:%M:%SZ')" > dist/version
@@ -141,27 +111,29 @@ commands:
141111
name: "Publish to cloudflare pages (production)"
142112
command: |
143113
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
145115
echo "New website - http://cf-pages-binary-static.binary.com"
146116
jobs:
147117
test:
148118
docker:
149119
- image: circleci/node:14-stretch
150120
steps:
151-
- git_checkout_from_cache
121+
- checkout
152122
- npm_install
153123
- test
154124
release_staging:
155125
docker:
156126
- image: circleci/node:14-stretch
157127
steps:
158-
- git_checkout_from_cache
128+
- checkout
159129
- npm_install
160130
- test
161131
- build:
162132
target: 'staging'
163133
- build:
164134
target: 'translations'
135+
- versioning:
136+
target_branch: "staging"
165137
- persist_to_workspace:
166138
root: dist
167139
paths:
@@ -175,42 +147,32 @@ jobs:
175147
docker:
176148
- image: circleci/node:14-stretch
177149
steps:
178-
- git_checkout_from_cache
150+
- checkout
179151
- npm_install
180152
- test
181153
- build:
182154
target: 'production'
155+
- versioning:
156+
target_branch: "production"
183157
- persist_to_workspace:
184158
root: dist
185159
paths:
186160
- .
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'
199161
- docker_build_push:
200162
docker_latest_image_tag: latest
201163
docker_image_tag: ${CIRCLE_TAG}
202164
- k8s_deploy:
203165
k8s_svc_name: "production-binary-com"
204166
k8s_namespace: "www-binary-com-production"
205167
k8s_version: ${CIRCLE_TAG}
168+
- notify_slack
206169
publish_cloudflare_staging:
207170
docker:
208171
- image: circleci/node:16.13.1-stretch
209172
steps:
210173
- attach_workspace:
211174
at: dist
212175
- publish_to_pages_staging
213-
214176
publish_cloudflare_production:
215177
docker:
216178
- image: circleci/node:16.13.1-stretch
@@ -247,13 +209,6 @@ workflows:
247209
tags:
248210
only: /^production.*/
249211
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
257212
- publish_cloudflare_production:
258213
requires:
259214
- release_production

0 commit comments

Comments
 (0)