-
Notifications
You must be signed in to change notification settings - Fork 40
/
rakefile
33 lines (28 loc) · 890 Bytes
/
rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require "jekyll"
require "tmpdir"
# Change your GitHub reponame
GITHUB_REPONAME = "andismith/dev-tool-secrets"
namespace :site do
desc "Generate DevToolSecrets files"
task :generate do
Jekyll::Site.new(Jekyll.configuration({
"source" => ".",
"destination" => "_site"
})).process
end
desc "Generate and publish blog to gh-pages"
task :publish => [:generate] do
Dir.mktmpdir do |tmp|
cp_r "_site/.", tmp
Dir.chdir tmp
system "echo devtoolsecrets.com >> CNAME"
system "git init"
system "git add ."
system "git rm -r assets/js/compiler.jar --cached"
message = "Site updated at #{Time.now.utc}"
system "git commit -m #{message.shellescape}"
system "git remote add origin https://github.com/#{GITHUB_REPONAME}.git"
system "git push origin master:refs/heads/gh-pages --force"
end
end
end