-
-
Notifications
You must be signed in to change notification settings - Fork 118
/
circle.yml
75 lines (74 loc) · 2.59 KB
/
circle.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
67
68
69
70
71
72
73
74
75
version: 2
jobs:
build:
docker:
- image: circleci/node:9.2.1
working_directory: ~/injectify
steps:
- checkout
- restore_cache:
keys:
- dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run:
name: Install Dependencies
command: yarn run install:all
- save_cache:
key: dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules
- interface/src/node_modules
- ci/node_modules
- src/inject/core/node_modules
- run:
name: Discord Webhook
command: (cd ci && chmod -R +x . && node status ci-start)
- run:
name: Compiling Typescript
command: yarn run tsc:silent || (node ci/status ci-failure; exit 1)
- run:
name: Building Interface
command: yarn run build:silent && (node ci/status ci-success) || (node ci/status ci-failure; exit 1)
- run:
name: Cleanup node_modules
command: cd ~/injectify/ && find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
- save_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
# Paths that will be compiled & uploaded to the server
paths:
- ~/injectify/src
- ~/injectify/interface/public
- ~/injectify/ci/deploy.sh
deploy:
docker:
- image: circleci/node:9.2.1
working_directory: ~/injectify
steps:
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- add_ssh_keys:
fingerprints:
- "98:78:21:de:7c:23:ec:4d:4e:e0:45:93:05:67:00:15"
- run:
name: Add key to known_hosts
command: mkdir -p ~/.ssh && echo "ssh.samdd.me ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDlTLWwCVki+LL1R/5lrdmth2Aa/MRlPjU/FGzNo3gUX67D8pugEMCxOlz/FfB7TGg3WKIrMKI357hSjd8FcWOD1zwEsBG3o1UZKZg21nBVhuuFzlcSIxLr4va4rzA+B+LzzDdNn65Iox80ihFMCl9DtOJvjvOqmRuhfFwa1pmU5g/0wDun3RKlIv9QCAcaiU2jY2OzrTJDbFLGY7vG3PcY9Bf7D+QN2tNEjeJuKa3jZkU6YdeVfLWOGUt1Bce5nn2W47Cx3qNdeMhHnQvT+VGVWRDFgp709yI0XwaX2kafsoS04Xbp258OP2Q0G7pEqZSAc4x32wN5sqxL3SV2QlGT" >> ~/.ssh/known_hosts
- deploy:
name: Deploy to ssh.samdd.me
command: bash ./ci/deploy.sh
workflows:
version: 2
build-test-deploy:
jobs:
- build
- hold:
type: approval
filters:
branches:
only: master
requires:
- build
- deploy:
filters:
branches:
only: master
requires:
- hold