Last active
September 25, 2018 05:28
-
-
Save danielbrinneman/e0e90a3fd18eb42d9e35581210a9490d to your computer and use it in GitHub Desktop.
Jekyll Codeship Rakefile GitHub Pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "[email protected]"' | |
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 [email protected]: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 "[email protected]"' | |
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 [email protected]: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