-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
43 lines (38 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
35
36
37
38
39
40
41
42
43
sudo: false
language: node_js
node_js:
- 10 # use nodejs v10 LTS
cache: npm
branches:
only:
- master # build master branch only
# 设置缓存文件
#cache:
# directories:
# - node_modules
#在构建之前安装hexo环境
before_install:
- npm install -g hexo-cli
#安装git插件和搜索功能插件
install:
- npm install
# 设置git提交名,邮箱;替换真实token到_config.yml文件
before_script:
- git config user.name "Xuezhi.Zhang"
- git config user.email "algoboy@126.com"
# 替换同目录下的_config.yml文件中github_token字符串为travis后台刚才配置的变量,注>意此处sed命令用了双引号。单引号无效!
- sed -i "s/github_token/${GH_TOKEN}/g" _config.yml || exit 1
- cat _config.yml
# 执行清缓存,生成网页操作
script:
- hexo clean
- hexo generate # generate static files
- hexo deploy
# deploy:
# provider: pages
# skip-cleanup: true
# github_token: $github_token
# keep-history: true
# on:
# branch: master
# local-dir: public