-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
27 lines (24 loc) · 1.24 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
language: node_js # 指定语言环境
node_js: '12.16.1' # 指定 NodeJS 版本
cache: npm # 指定 npm 缓存方案,会缓存 $HOME/.npm 或 node_modules 文件夹
branches: # 指定要构建的分支
only: # only 表示只构建以下分支
- master
before_install: # install 阶段之前执行
- npm install -g hexo-cli # 全局安装 Hexo 命令行工具
- export TZ='Asia/Shanghai' # 设置时区
install: # 在安装项目环境阶段需要运行的命令,一条一行,类似的还有 before_install
- npm install # 安装 package.json 中的依赖
script: # 在构建阶段需要运行的命令,一条一行,类似的还有 before_script、after_script
- hexo clean
- hexo generate # Hexo 常规命令,执行清理和生成
after_script:
- git config user.name "codingbylch"
- git config user.email "ilinf@foxmail.com"
- git commit -m "Update docs by TRAVIS-CI."
- sed -i'' "s~git@github.com:~https://${GIT_REPO_TOKEN}@github.com/~" _config.yml
- hexo deploy > /dev/null # 通过 Hexo 的 deploy 命令部署博客
# safelist
branches:
only:
- master