forked from zellwk/zellwk.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
73 lines (73 loc) · 1.96 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
version: 2.1
jobs:
build-and-deploy:
# pre-built images: https://circleci.com/docs/2.0/circleci-images/
docker:
- image: cimg/python:3.9.1-node
steps:
- checkout
- restore_cache:
keys:
- npm-deps-{{ .Branch }}-{{ checksum "package-lock.json" }}
- tmp-images-{{ .Branch }}-
- run:
name: Install files
#
command: npm install
- save_cache:
key: npm-deps-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run:
name: Build
command: npm run build
- run:
name: Check for built files
command: |
cd dist
ls -l
- add_ssh_keys:
fingerprints:
- "c7:53:7e:6b:71:5b:4e:92:40:45:fb:90:2c:0d:80:74"
- run:
# https://discuss.circleci.com/t/capistrano-and-ssh-host-authenticity/13586/7
name: Fix Authenticity of hosts
command: ssh-keyscan 192.241.199.177 >> ~/.ssh/known_hosts
- run:
name: Deploy static site
# DeployCI requires rsync
command: |
sudo apt-get install rsync
npm run deployCI
- run:
name: Restart node server
command: |
ssh $SSH_USER@$SSH_HOST "
cd /home/zellwk/zellwk.com
git fetch origin master
git reset --hard FETCH_HEAD
git clean -d -f --exclude secrets
npm install --production
npm run restart
exit"
workflows:
version: 2
commit:
jobs:
- build-and-deploy:
filters:
branches:
only:
- master
- circleci
nightly:
triggers:
- schedule:
# Everyday at 12am UTC
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- build-and-deploy