-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
48 lines (47 loc) · 1.32 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
#设置语言
language: node_js
# 指定需要sudo权限
sudo: required
#设置相应的版本
node_js:
- 10.15.0
# 指定缓存模块,可选。缓存可加快编译速度。
cache:
directories:
- node_modules
before_install:
- npm install -g hexo-cli
#安装hexo及插件
install:
- npm install
- npm install hexo-deployer-git --save
- npm i -g yuque-hexo
# yuque-hexo clean 清除语雀文章,并清除“yuque-hexo”的json文件“yuque.json”
# yuque-hexo sync 同步语雀的文章,并创建json文件“yuque.json”
# hexo clean 清理文章
# hexo generate 重新发布文章
script:
- yuque-hexo clean
- yuque-hexo sync
- hexo clean
- hexo generate
# iszengmh修改成自己的github用户名
# [email protected]修改成自己的GitHub邮箱
# GH_token就是在travis中设置的token,等下会告诉大家怎么配置
# GH_REF 是下面仓库地址
after_script:
- cd ./public
- git init
- git config user.name "muzhi621"
- git config user.email "[email protected]"
- git add .
- git commit -m "update by Travis-CI"
- git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:master
#只监测这个分支,一有动静就开始构建
branches:
only:
- source
# GH_REF 仓库地址
env:
global:
- GH_REF: github.com/muzhi621/muzhi621.github.io