Last active
September 7, 2016 23:09
-
-
Save vmlinz/66d1735fbda050394a3b to your computer and use it in GitHub Desktop.
Deploy hexo site with travis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://zespia.tw/blog/2015/01/21/continuous-deployment-to-github-with-travis/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
node_js: | |
- "0.10" | |
before_install: | |
# Decrypt the private key | |
- openssl aes-256-cbc -K $encrypted_06b8e90ac19b_key -iv $encrypted_06b8e90ac19b_iv -in .travis/ssh_key.enc -out ~/.ssh/id_rsa -d | |
# Set the permission of the key | |
- chmod 600 ~/.ssh/id_rsa | |
# Start SSH agent | |
- eval $(ssh-agent) | |
# Add the private key to the system | |
- ssh-add ~/.ssh/id_rsa | |
# Copy SSH config | |
- cp .travis/ssh_config ~/.ssh/config | |
# Set Git config | |
- git config --global user.name "Tommy Chen" | |
- git config --global user.email tommy351@gmail.com | |
# Install Hexo | |
- npm install hexo@beta -g | |
# Clone the repository | |
- git clone https://github.com/hexojs/hexojs.github.io .deploy | |
script: | |
- hexo generate | |
- hexo deploy | |
branches: | |
only: | |
- master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment