-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
35 lines (28 loc) · 900 Bytes
/
Copy path.travis.yml
File metadata and controls
35 lines (28 loc) · 900 Bytes
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
language: node_js
node_js: stable
cache:
directories:
- node_modules
before_install:
- npm install -g hexo-cli
install:
- npm install
before_script:
- git config --global user.name "mu-yu"
- git config --global user.email "490769750@qq.com"
# 替换同目录下的_config.yml文件中gh_token字符串为travis后台刚才配置的变量,注意此处sed命令用了双引号。单引号无效!
- sed -i "s/github.com\/mu-yu/${GH_TOKEN}@github.com\/mu-yu/g" ./_config.yml
script:
- hexo clean
- hexo g
after_script:
- git clone --branch=master https://github.com/mu-yu/mu-yu.github.io.git .deploy_git
- cd .deploy_git
# Remove all files before they get copied from ../public/
# so git can track files that were removed in the last commit
- find . -path ./.git -prune -o -exec rm -rf {} \; 2> /dev/null
- cd ..
- hexo deploy
branches:
only:
- hexo