-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
34 lines (32 loc) · 1.02 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
language: node_js #设置语言
node_js: stable #设置相应的版本
cache:
directories:
- node_modules #据说可以减少travis构建时间
before_install:
- npm install -g hexo
- npm install -g hexo-cli
- npm install -g hexo-generator-feed
- npm install -g hexo-generator-searchdb
install:
- npm install #安装hexo及插件
before_script:
- npm install -g mocha
- git clone --branch master https://github.com/luyh/luyh.github.io.git public
script:
- hexo cl #清除
- hexo g #生成
after_script:
- cd ./public
- git init
- git config user.name "luyh" #修改成自己的github用户名
- git config user.email "[email protected]" #修改成自己的GitHub邮箱
- git add .
- git commit -m "update by Travis-CI"
- git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:master #GH_token就是在travis中设置的token
branches:
only:
- hexo #只监测这个分支,一有动静就开始构建
env:
global:
- GH_REF: github.com/luyh/luyh.github.io.git