Skip to content

Instantly share code, notes, and snippets.

@danielbrinneman
Last active September 25, 2018 05:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save danielbrinneman/e0e90a3fd18eb42d9e35581210a9490d to your computer and use it in GitHub Desktop.
Jekyll Codeship Rakefile GitHub Pages
system rake generate
system rake publish
require 'tmpdir'
desc "Generate jekyll site"
task :generate do
puts "## Install bundles"
system "bundle install"
puts "## Generating Site with Jekyll"
system "bundle exec jekyll build --incremental"
puts "## Jekyll Webmention"
system "jekyll webmention"
system 'git config --global user.email "kg4dni@gmail.com"'
system 'git config --global user.name "Daniel Brinneman"'
puts "## Commit Jekyll Webmention changes"
system "git add ."
system "git commit -m 'commit full-local-backup changes'"
system "git remote add ghub git@github.com:danielbrinneman/danielbrinneman.github.io.git"
system "git push -f ghub full-local-backup"
end
#desc "Generate and publish website to master"
task :publish do
Dir.mktmpdir do |tmp|
system "cp _site/* #{tmp}"
system "git checkout -b master"
system "rm -rf *"
system "mv #{tmp}/* ."
system 'git config --global user.email "kg4dni@gmail.com"'
system 'git config --global user.name "Daniel Brinneman"'
system 'touch .nojekyll'
system 'git add .nojekyll'
system "git add ."
system "git commit -m 'Codeship Update'"
system "git remote add ghub git@github.com:danielbrinneman/danielbrinneman.github.io.git"
system "git push -f ghub master"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment