-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml.bak
48 lines (42 loc) · 2.27 KB
/
.travis.yml.bak
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
node_js: stable
before_install:
- export TZ='Asia/Shanghai' # update time zone
- npm install gitbook-cli -g # install gitbook
- node --version
- npm --version
- gitbook fetch 3.2.3 # fetch final stable version
- gitbook install # add any requested plugins in book.json
- name="\"`git log -1 --pretty=format:'%an'`\""
- email="\"`git log -1 --pretty=format:'%ae'`\""
script:
- gitbook build . docs/ # build to docs path
- cp CNAME docs/
- cp README.md docs/
after_script:
- git clone --depth=1 --branch=master https://${GH_REF} .deploy_git # GH_REF是最下面配置的仓库地址
- cd .deploy_git
- cd ../
- mv .deploy_git/.git/ ./docs/ # 这一步之前的操作是为了保留master分支的提交记录,不然每次git init的话只有1条commit
- cd ./docs/
- git config user.name $name # 修改name
- git config user.email $email # 修改email
- git add .
- git commit -m "Travis-CI Auto Builder at `date +"%Y-%m-%d %H:%M"`" # 提交记录包含时间 跟上面更改时区配合
- git push --quiet "https://${GITHUB_TOKEN}@${GH_REF}" master:master # GH_TOKEN是在Travis中配置环境变量的名称
# deploy:
# provider: pages
# skip-cleanup: true
# github-token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
# keep-history: true
# local-dir: ./docs/
# # commit_message: "Deploy release at `date +"%Y-%m-%d %H:%M"`"
# on:
# branch: dev
branches:
only:
- dev # 只监测这个分支,一有动静就开始构建
env:
global:
- GH_REF: github.com/SUSTC/sustc.github.io.git
- secure: "NF/iP9qW8FXy1VjNVUxDpjUnfEb1yy0ZDdnw15jjMquY+0NaNjECg4Rc8H5f9B6nMzCfvNFXzV6nN+tut6CdTF2MHF1pVV1agm7Hm3VBMxgRifBU1T2nz2AlI1k6PafiAbDkXik4YFbl5dO8FSxn4y2/i7KFSZqQw8BAUmC3xG4K51zyqIXmHj+J0llnqZsYXCrGt6xswLuFEEtp94qnMS0BXsMTVEKnFZC6bmJlsTcaoYIYmf8qEV77VICuiabLQ2n+fPs86FcrRVfNRWfRF0ujD2l9N1fVBhHwo4tEi52J0qlKH5ZyjGTShiUC9WuhWGNxxD5Zw2Lhi+wIcPwz3KkfI/luDTK9SrzNJGAsDHNuYq6BAZ37YqFgyZFaGi0AE/OswyDmCFyFCzXLluM+WSzhbXZXmIbbAc5CEMKTidoMA1coUnKyI5ifNgVYUvITqDS/HUy7zE4n0oU/W0BwynLPMylNA4lykAfmeJdZl91450YSM1/GTbtbGzSc2L9uojUJ1rkNdO1WPjvKKn1jfvCsQ2e/yPAnge3jM3LwLnbR9+FX0vSaGoIQQYiInjR8ucB7uxZZlCmFfQd1vlYSSqdaddcrTySORKZJhu4GoeQsoJfEWWZAHw0aKJdWD8kQxJjP96eRuY8zkejNq7gJcPgzBPX2XSx+J85NYcSOvGU="