forked from clayallsopp/rubymotion-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
26 lines (26 loc) · 721 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
task :deploy do
system 'git checkout master'
system 'rm -rf ./_site'
system 'mkdir _site'
system 'jekyll'
system 'rm -rf ../_site'
system 'cp -r ./_site ../_site'
system 'git checkout gh-pages'
Dir[`pwd`[0..-2] + "/*"].each do |file|
skip = ["CNAME", "sitemap", "Rakefile", "README"]
next if file.include? "CNAME" or file.include? "sitemap" or file.include? "Rakefile"
begin
FileUtils.rm_rf(file)
rescue
FileUtils.rm(file)
end
end
system 'mv ../_site/* ./'
system 'git status'
msg = `git status`
system 'git add .'
system "git commit -m 'Sync gh-pages \n #{msg}'"
system 'git push origin gh-pages'
system 'git checkout master'
system 'rm -rf ../_site'
end