Skip to content

Instantly share code, notes, and snippets.

@vmlinz
Last active September 7, 2016 23:09
Show Gist options
  • Save vmlinz/66d1735fbda050394a3b to your computer and use it in GitHub Desktop.
Save vmlinz/66d1735fbda050394a3b to your computer and use it in GitHub Desktop.
Deploy hexo site with travis
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