-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
38 lines (36 loc) · 1.13 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
# 指定语言环境
language: node_js
# 指定需要sudo权限
sudo: required
# 指定node_js版本
node_js:
- 14/*
# 指定缓存模块,可选。缓存可加快编译速度。
# cache:
# directories:
# - node_modules
# 指定博客源码分支,因人而异。hexo博客源码托管在独立repo则不用设置此项
# branches:
# only:
# - hexo
# before_install:
# - npm install -g vuepress
# Start: Build Lifecycle
install:
- npm install
# 执行清缓存,生成网页操作
script:
- npm run docs:build
# 设置git提交名,邮箱;替换真实token到_config.yml文件,最后depoy部署
after_script:
- cd docs/.vuepress/dist
# - echo 'xx.xx' > CNAME
- git init
- git config user.name "${GIT_USER_NAME}"
- git config user.email "${GIT_USER_EMAIL}"
- git add -A
- git commit -m 'auto-deploy'
- git push -f -q "https://${GITHUB_ACCESS_TOKEN}@${REPO}" master
# 替换同目录下的_config.yml文件中gh_token字符串为travis后台刚才配置的变量,注意此处sed命令用了双引号。单引号无效!
# End: Build LifeCycle
#- sed -i "s/regclientId/123/" docs/.vuepress/config.js