-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
86 lines (85 loc) · 2.51 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
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
sudo: false
branches:
only:
- master
language: node_js
node_js:
- stable
before_install:
- export TZ=Asia/Beijing
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# Deployment
- openssl aes-256-cbc -K $encrypted_8c46388de977_key -iv $encrypted_8c46388de977_iv -in .travis/id_rsa.enc -out ~/.ssh/id_rsa -d
# 改变文件权限
- chmod 600 ~/.ssh/id_rsa
# 配置 ssh
- eval $(ssh-agent)
- ssh-add ~/.ssh/id_rsa
- cp .travis/ssh_config ~/.ssh/config
# 配置 git 信息
- git config --global user.name 'Travis CI'
- git config --global user.email travis@jimmylv.com
script:
# - npm install -g firebase-tools
# - rm -rf .happypack
- npm install -g yarn
- yarn install --pure-lockfile
- npm run clean
- npm run lint
- npm run build
- cat scripts/conf.json.in | sed -e "s/QiNiuAK/$QiNiuAK/" | sed -e "s/QiNiuSK/$QiNiuSK/" > scripts/conf.json
- wget http://devtools.qiniu.io/qiniu-devtools-linux_amd64-current.tar.gz
- tar xfz qiniu-*.tar.gz
- ./qrsync scripts/conf.json
after_script:
- npm run test:codecov
cache:
directories:
- node_modules
- ~/.npm
# deploy:
# provider: s3
# access_key_id: $S3_ACCESS_KEY_ID
# secret_access_key: $S3_SECRET_KEY
# bucket: nobackend.website
# region: ap-southeast-1
# skip_cleanup: true
# local_dir: public
# on:
# branch: gh-pages
#deploy:
# provider: releases
# api_key: "GITHUB OAUTH TOKEN"
# file: "FILE TO UPLOAD"
# skip_cleanup: true
# on:
# tags: true
after_success:
# - firebase deploy --email ${FIREBASE_USERNAME} --password ${FIREBASE_PASSWORD}
- bash <(curl -s https://codecov.io/bash)
# Deploy to Coding Page
- |
cd public
cat index.html
touch .nojekyll
git init
git add .
git commit -m "Deploy at `date +"%Y-%m-%d %H:%M"`"
# Make sure to make the output quiet, or else the API token will leak!
# This works because the API key can replace your password.
git push -f -q git@git.coding.net:jimmylv/haiku.git master:coding-pages > /dev/null 2>&1
# Deploy to GitHub Page
- |
if [ -n "$GITHUB_API_KEY" ]; then
# cp CNAME public/CNAME
cp _config.yml public/_config.yml
cd public
git init
git add .
git commit -m "Deploy at `date +"%Y-%m-%d %H:%M"`"
# Make sure to make the output quiet, or else the API token will leak!
# This works because the API key can replace your password.
git push -f -q https://$GITHUB_API_KEY@github.com/JimmyLv/Haiku.git master:gh-pages > /dev/null 2>&1
fi