Deploy static files with Travis-CI to your own server.
Configuration
Add the gem to your Gemfile or gemspec.
gem "travis-custom-deploy", "~> 0.0.6"
To use travis-custom-deploy with Travis-CI you need to define environment variables. I recommend to use secure environment variables with Travis-CI. The best way to do that is to use travis gem:
gem install travis
cd my_project
travis encrypt DEPLOY_HOST="your-hostname.com" --add
travis encrypt DEPLOY_USERNAME="username" --add
travis encrypt DEPLOY_PASSWORD="password" --add
travis encrypt DEPLOY_REMOTEDIR="/path/to/deploy/" --add
To trigger the deployment you have to add the following line to your ~/.travis.yml
file:
after_success: bundle exec travis-custom-deploy sftp _site/
Example:
language: ruby
rvm: 2.0.0
env:
global:
- secure: <hash>
- secure: <hash>
- secure: <hash>
- secure: <hash>
script:
- bundle exec jekyll build --trace
- bundle exec ./script/htmlcheck
after_success: bundle exec travis-custom-deploy sftp _site/
Protocol support
The protocol to use to transfer the files to the remote server.
SFTP
Necessary environment variables:
DEPLOY_HOST
DEPLOY_USERNAME
DEPLOY_PASSWORD
DEPLOY_REMOTEDIR
Example:
after_success: bundle exec travis-custom-deploy sftp files/
Services
There are predefined services available. For example if you want to deploy a Jekyll page you can write:
after_success: travis-custom-deploy sftp service:jekyll
Services currently availble:
Service File
-------- -------
jekyll _site/
License and Copyright
Licensed under the MIT license.
Jens Nazarenus, 2014