This repository has been archived by the owner on Jul 8, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 132
/
config.yml
66 lines (54 loc) · 1.62 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
version: 2.0
jobs:
build:
docker:
- image: circleci/node:14
working_directory: ~/fastify-website
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- v1-releases-cache
- run:
name: Install dependencies
command: npm ci
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- save_cache:
paths:
- build-temp/releases
key: v1-releases-cache
- run:
name: Test
command: npm test
- run:
name: Build
command: npm run build
- deploy:
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
echo "$DOMAIN" > build/CNAME
cp -r .circleci build/.circleci
git config --global user.email "$GH_EMAIL"
git config --global user.name "$GH_NAME"
NODE_DEBUG=gh-pages npm run deploy -- -m 'automated build'
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE/purge_cache" \
-H "X-Auth-Email: $CLOUDFLARE_EMAIL" \
-H "X-Auth-Key: $CLOUDFLARE_AUTH_KEY" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'
else
echo "Not master branch so not deploying"
fi
workflows:
version: 2
build:
jobs:
- build:
filters:
branches:
ignore: gh-pages