-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
56 lines (49 loc) · 1.34 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
# 指定环境语言
language: node_js
# 指定sudo权限
sudo: required
# 指定node版本
node_js: stable
# 指定缓存模块,缓存可以加速编译
cache:
directories:
- node_modules
# 邮件通知,这里配置不管成功或是失败都通知
notifications:
email:
recipients:
on_success: always # default: change
on_failure: always # default: always
# 构建的分支
branches:
only:
- gitbook
# 调整时区
before_install:
- export TZ='Asia/Shanghai'
# 安装环境
install:
- npm install -g gitbook-cli
- gitbook install
# gitbook生成静态文件
script:
- gitbook build
# 生成文件后,进入静态文件目录,部署到指定仓库,需要填写用户名,邮件
after_script:
- cp ./seo/* ./_book/
- cd ./_book
- git init
- git config user.name "taylortaurus"
- git config user.email "[email protected]"
- git add .
- git commit -m "Update GitBook By TravisCI With Build $TRAVIS_BUILD_NUMBER"
- git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:master
- git push --force --quiet "https://taylortaurus:${CO_TOKEN}@${CO_REF}" master:master
# 环境变量
env:
global:
# Github Pages
- GH_REF: github.com/taylortaurus/Ranorex_UserGuide_zh_CN
# Coding Pages
- CO_REF: git.coding.net/taylortaurus/Ranorex_UserGuide_zh_CN.git