-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.travis.yml
51 lines (43 loc) · 1.01 KB
/
.travis.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
language: node_js
node_js:
- node
addons:
ssh_known_hosts:
- $DEPLOY_HOST
env:
global:
- BUILD_PATH=dist
matrix:
- ENV=development
- ENV=staging NODE_ENV=production PUBLIC_PATH=/sabor-website/
- ENV=production NODE_ENV=production PUBLIC_PATH=/cu/sabor/
cache:
directories:
- node_modules
before_script:
- openssl aes-256-cbc -k $ENCRYPTION_KEY -in .npmrc.enc -out .npmrc -d
script:
- npm run build
before_deploy:
- ssh-keyscan -t $TRAVIS_SSH_KEY_TYPES -H $DEPLOY_HOST 2>&1 | tee -a $HOME/.ssh/known_hosts
- openssl aes-256-cbc -k $ENCRYPTION_KEY -in deploy_key.enc -out deploy_key -d
- eval "$(ssh-agent -s)"
- chmod 400 deploy_key
- ssh-add deploy_key
deploy:
- provider: pages
local_dir: $BUILD_PATH
skip_cleanup: true
github_token: $GITHUB_TOKEN
on:
branch: master
condition:
- $ENV = staging
- provider: script
skip_cleanup: true
script:
- rsync -r --delete-after $BUILD_PATH/* $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH
on:
branch: master
condition:
- $ENV = production