This repository has been archived by the owner on May 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfig.yml
120 lines (111 loc) · 3.1 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:8.11.1
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
<<: *defaults
steps:
- checkout
# Download and cache dependencies
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }}
- yarn-packages-{{ .Branch }}
- yarn-packages-master
- yarn-packages-
- run:
name: Install Dependencies
command: yarn install
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules/
# run builds!
- run:
name: Build
command: yarn run build
- store_artifacts:
path: ~/repo/dist
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory
root: ~/repo/
paths:
- dist
deploy-master:
<<: *defaults
steps:
- add_ssh_keys:
fingerprints:
- "b1:a7:69:a0:ba:d9:e2:12:bb:d1:60:39:ac:55:25:f1"
- attach_workspace:
at: ~/repo/dist
- run:
name: Keyscan Github (HACK)
command: ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- run:
name: Deploy to Github Pages
command: |
cd ./dist/dist
git config --global user.email "bot@frankwei.xyz"
git config --global user.name "Circle CI Deploy Bot"
echo "linkidol.pro" >> CNAME # add custom domain
git init
git add .
git commit -m "Update website"
git push --force --quiet git@github.com:LinkIdol/website-eth.git master:master
deploy-testing:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo/dist
- run:
# I don't want to bother with Github Page Deployment again.
# I am a front end hipster after all. ~_^
name: Deploy to Surge.sh
command: |
sudo npm i -g surge
cd ./dist/dist/
# echo "testing.linkidol.pro" >> CNAME # add custom domain
surge --project ./ --domain testing.linkidol.pro
workflows:
version: 2
build-test:
jobs:
- build:
filters:
branches:
ignore:
- /testing/
- /master/
build-and-deploy-to-testing:
jobs:
- build:
filters:
branches:
only: /testing/
- deploy-testing:
requires:
- build
filters:
branches:
only: /testing/
build-and-deploy-to-master:
jobs:
- build:
filters:
branches:
only: /master/
- deploy-master:
requires:
- build
filters:
branches:
only: /master/