forked from m2kar/m2kar.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
34 lines (26 loc) · 898 Bytes
/
.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
language: go
services:
- docker
branches:
only:
- blog # 设置自动化部署的源码分支
- 2-travis-auto-depoly # test for travis
# cache this directory
# cache:
# directories:
# - themes
#- themes 主题没有更改时可以缓存
# 安装依赖组件
before_install:
- export TZ='Asia/Shanghai' # 设置时区
# - docker pull imakar/docker-hugo:latest
- docker run --rm -it -v $PWD:/src -u ${UID}:hugo imakar/docker-hugo:0.56 hugo version
install:
- git log -p -2 | cat
- commit_msg="auto depoly $(date) $(git log -n1 --oneline)"
- git clone --recursive -b master https://${GH_APIKEY}@github.com/m2kar/m2kar.github.io.git public
script:
- docker run --rm -it -v $PWD:/src -u $UID:hugo imakar/docker-hugo:0.56 hugo
- pushd public
- ( git add . && git commit -m "${commit_msg}" && git push ) || echo "nothing to commit"
- echo "depoly done"