@@ -2,7 +2,9 @@ sudo: false
22language :node_js
33node_js :
44 -10 # use nodejs v10 LTS
5- cache :npm
5+ cache :
6+ directories :
7+ -node_modules
68branches :
79only :
810 -hexo # build hexo branch only
@@ -26,17 +28,29 @@ before_install:
2628install :
2729 -npm install
2830 -npm install hexo-deployer-git --save
31+
32+ # 设置git提交名,邮箱;替换真实token到_config.yml文件
33+ before_script :
34+ -git config user.name "coderhaotf"
35+ -git config user.email "2415156870@qq.com"
36+ # 替换同目录下的_config.yml文件中github_token字符串为travis后台刚才配置的变量,注>意此处sed命令用了双引号。单引号无效!
37+ -sed -i "s/gh_token/${GH_TOKEN}/g" ./_config.yml || exit 1
2938
3039# 执行清缓存,生成网页操作
3140script :
3241 -hexo clean
3342 -hexo generate
43+ -hexo deploy
3444
3545# 设置git提交名,邮箱;替换真实token到_config.yml文件,最后depoy部署
3646after_script :
37- -git config user.name "coderhaotf"
38- -git config user.email "2415156870@qq.com"
39- # 替换同目录下的_config.yml文件中gh_token字符串为travis后台刚才配置的变量,注意此处sed命令用了双引号。单引号无效!
40- -sed -i "s/gh_token/${GH_TOKEN}/g" ./_config.yml
41- -hexo deploy
47+
48+ # configure notifications (email, IRC, campfire etc)
49+ # please update this section to your needs!
50+ # https://docs.travis-ci.com/user/notifications/
51+ notifications :
52+ email :
53+ -2415156870@qq.com
54+ on_success :change
55+ on_failure :always
4256# End: Build LifeCycle