CRCMS

高山仰止,景行行止,虽不能至,心向往之

大道至简


hexo 集成 travis ci 自动部署

增加github token至travis ci

  • github Settings->Developer settings->Personal access tokens生成一个travis token
    当出现如图Connection successful,则表示连接成功
  • 进入travis ci项目settings->Environment Variables增加token值为环境变量

设置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
language: node_js
node_js: stable

install:
- npm install

script:
- hexo g

after_script:
- cd ./public
- git init
- git config user.name "crcms"
- git config user.email "crcms@crcms.cn"
- git add .
- git commit -m "Update docs"
- git push --force --quiet "https://${GITHUB_TOKEN}@${GH_REF}" master:master

branches:
only:
- source
env:
global:
- GH_REF: github.com/crcms/crcms.github.io.git