Sha256: 93d1e9862af2bc56fad5eae04cd48eaf1cd5a9d4205e57fd2419c9e1e2e3a470
Contents?: true
Size: 885 Bytes
Versions: 16
Compression:
Stored size: 885 Bytes
Contents
require "rubygems" require "tmpdir" require "jekyll" # Change your GitHub reponame GITHUB_REPONAME = "pusher/chameleon" namespace :site do desc "Generate blog files" task :generate do Jekyll::Site.new(Jekyll.configuration({ "source" => ".", "destination" => "_site", "config" => ["_config.yml","_config.production.yml"] })).process end desc "Generate and publish blog to gh-pages" task :publish => [:generate] do Dir.mktmpdir do |tmp| cp_r "_site/.", tmp pwd = Dir.pwd Dir.chdir tmp system "git init" system "git add ." message = "Docs updated at #{Time.now.utc}" system "git commit -m #{message.inspect}" system "git remote add origin git@github.com:#{GITHUB_REPONAME}.git" system "git push origin master:refs/heads/gh-pages --force" Dir.chdir pwd end end end
Version data entries
16 entries across 16 versions & 2 rubygems