Skip to content

Instantly share code, notes, and snippets.

@ryanlid
Created July 16, 2018 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanlid/2a5c496e38491ab90fae86ad1fc0a5aa to your computer and use it in GitHub Desktop.
Save ryanlid/2a5c496e38491ab90fae86ad1fc0a5aa to your computer and use it in GitHub Desktop.
Hexo Travis CI settings
#!/bin/bash
set -ev
export TZ='Asia/Shanghai'
# 先 clone 再 commit,避免直接 force commit
git clone -b gh-pages https://github.com/ryanlid/blog.git .deploy_git
cd .deploy_git
git checkout gh-pages
mv .git/ ../public/
cd ../public
git add .
git commit -m "Site updated: `date +"%Y-%m-%d %H:%M:%S"`"
git push --quiet --force https://$REPO_TOKEN@github.com/ryanlid/blog gh-pages:gh-pages
@ryanlid
Copy link
Author

ryanlid commented Jul 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment