add travis

This commit is contained in:
khs1994
2017-09-04 12:47:22 +08:00
parent 3e5e6bcd75
commit b470de0882
3 changed files with 60 additions and 0 deletions

29
.travis/deploy.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
git clone -b gh-pages "$REPO" .deploy_git
- git ls-files | while read file; do touch -d $(git log -1 --format="@%ct" "$file") "$file"; done
if [ ! $? = 0 ];then
#不存在
echo -e "\033[31mINFO\033[0m BRANCH <gh-pages> NOT exist"
mkdir .deploy_git
cd .deploy_git
git init
git remote add origin $REPO
git checkout -b gh-pages
cd ..
else
#存在
echo -e "\033[32mINFO\033[0m BRANCH exist"
rm -rf .deploy_git/*
fi
# Deploy to GitHub and aliyun
cp -r _book/* .deploy_git/
cd .deploy_git
git add .
COMMIT=`date "+%F %T"`
TAG=`date '+%s'`
git commit -m "Travis CI Site updated: $COMMIT"
git push -f origin gh-pages
git tag | tail -10
git tag
git tag $TAG
git push origin $TAG

BIN
.travis/khs1994-robot.enc Normal file

Binary file not shown.