@@ -10,52 +10,18 @@ rescue LoadError => e
1010 exit -1
1111end
1212
13- task :default => [ :generate ]
13+ task :default => [ :build ]
1414
15- desc "Generates the Jekyll site"
16- task :generate do
17- require 'jekyll'
18- # workaround for LANG=C environment
19- module Jekyll ::Convertible
20- Encoding . default_external = Encoding ::UTF_8
21- end
22-
23- options = Jekyll . configuration ( { 'auto' => false , 'server' => false } )
24- puts "Building site: #{ options [ 'source' ] } -> #{ options [ 'destination' ] } "
25- $stdout. flush
26- Jekyll ::Site . new ( options ) . process
15+ desc "Build the Jekyll site"
16+ task :build do
17+ sh 'jekyll build'
2718end
2819
2920desc "Generates the Jekyll site and starts local server"
3021task :preview do
3122 sh 'jekyll serve --watch'
3223end
3324
34- desc "Release the current commit to ruby-korea/ruby-korea.github.io@gh-pages"
35- task :release do
36- commit = `git rev-parse HEAD` . chomp
37- system "mkdir -p vendor/ruby-korea.github.io"
38- system "git clone https://github.com/ruby-korea/ruby-korea.github.io.git vendor/ruby-korea.github.io"
39-
40- Dir . chdir "vendor/ruby-korea.github.io" do
41- sh "git config user.name '#{ ENV [ 'GIT_NAME' ] } '"
42- sh "git config user.email '#{ ENV [ 'GIT_EMAIL' ] } '"
43- sh 'git config credential.helper "store --file=.git/credentials"'
44- File . open ( '.git/credentials' , 'w' ) do |f |
45- f . write ( "https://#{ ENV [ 'GH_TOKEN' ] } :@github.com" )
46- end
47- sh "git reset --hard HEAD"
48- sh "git checkout gh-pages"
49- sh "git pull origin gh-pages"
50-
51- rm_rf FileList [ "*" ]
52- cp_r FileList [ "../../_site/*" ] , "./"
53- sh "git add -A ."
54- sh "git commit -m 'ruby-korea/ruby-korea.github.io@#{ commit } '"
55- sh "git push origin gh-pages"
56- end
57- end
58-
5925namespace :check do
6026 desc 'validate _site markup with validate-website'
6127 task :markup => :generate do
0 commit comments