Skip to content

Commit 9c14231

Browse files
committed
Add release script
1 parent 3aabdf2 commit 9c14231

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎Rakefile‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,22 @@ desc "Generates the Jekyll site and starts local server"
3333
task :preview do
3434
sh 'jekyll serve --watch'
3535
end
36+
37+
desc "Release the current commit to ruby-korea/ruby-korea.github.io@gh-pages"
38+
task :release do
39+
commit = `git rev-parse HEAD`.chomp
40+
system "mkdir -p vendor/ruby-korea.github.io"
41+
system "git clone git@github.com:ruby-korea/ruby-korea.github.io.git vendor/ruby-korea.github.io"
42+
43+
Dir.chdir "vendor/ruby-korea.github.io" do
44+
sh "git reset --hard HEAD"
45+
sh "git checkout gh-pages"
46+
sh "git pull origin gh-pages"
47+
48+
rm_rf FileList["*"]
49+
cp_r FileList["../../_site/*"], "./"
50+
sh "git add -A ."
51+
sh "git commit -m 'ruby-korea/ruby-korea.github.io@#{commit}'"
52+
sh "git push origin gh-pages"
53+
end
54+
end

0 commit comments

Comments
 (0)