-
Notifications
You must be signed in to change notification settings - Fork 0
Deployment
Deploying Jekyll? No problem: Just copy the generated _site
to somewhere that your favorite web server can serve it up. There’re also automated ways to do it, listed below. If you’ve created your own way, edit away!
If you store your jekyll site in git, it’s pretty easy to automate the deployment process by setting up a post-update hook in your git repository, like this (<- Broken link, any alternative?).
This is where it’s at. You created a user account named deployer which has all the users public keys that are authorized to deploy in its `authorized_keys` file right? Great, deploying Jekyll is this easy then:
laptop$ ssh [email protected]
server$ mkdir myrepo.git
server$ cd myrepo.git
server$ git --bare init
server$ cp hooks/post-receive.sample hooks/post-receive
server$ mkdir /var/www/myrepo
Add the following lines to hooks/post-receive and be sure jekyll is installed on the server
GIT_REPO=$HOME/myrepo.git
TMP_GIT_CLONE=$HOME/tmp/myrepo
PUBLIC_WWW=/var/www/myrepo
git clone $GIT_REPO $TMP_GIT_CLONE
jekyll --no-auto $TMP_GIT_CLONE $PUBLIC_WWW
rm -Rf $TMP_GIT_CLONE
exit
Finally do the following on any users laptop that needs to be able to deploy
laptops$ git remote add deploy [email protected]:~/myrepo.git
Deploying is now as easy as telling nginx or apache to look at /var/www/myrepo and running the following:
laptops$ git push deploy master
BOOM!
Another way to deploy your jekyll site is to use rake, highline, and net-ssh, like used for litanyagainstfear A more complex example that deals with multiple branches used in gitready.
Just generate the _site
and rsync it, e.g. with a tasks/deploy
shell script.
There’s even a TextMate command to run this script.
As sometimes you don’t have anything else than FTP to deploy your site (not dedicated hosting), with glynn, you can easily generate your jekyll powered website’s static files and send them to your host through ftp.
Easy way to deploy your site on any server (EC2, Slicehost, Heroku, etc) with rack-jekyll. It also can run with shotgun , rackup , mongrel, unicorn , and more…
See rack-jekyll’s README
Read this post on how to deploy to Heroku
If you want to maintain Jekyll inside your existing Rails app, Jekyll-Admin contains drop in code to make this possible. See Jekyll-Admin’s README