-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
48 lines (40 loc) · 1.04 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
require "date"
require "time"
require "httparty"
require "json"
desc "运行"
task :run do
system "bundle exec jekyll serve --incremental --port 10224"
end
desc "部署"
task :deploy do
dir = "../.tmp/future-js"
unless FileTest.directory?("../.tmp")
system "mkdir ../.tmp"
end
unless FileTest.directory?(dir)
system "mkdir #{dir}"
cd dir do
system "git init"
system "git remote add origin https://github.com/future-js/homepage.git"
system "git fetch"
system "git checkout gh-pages"
end
else
cd dir do
# system "git reset --hard HEAD"
system "git pull origin gh-pages"
end
end
system "bundle exec jekyll clean"
system "JEKYLL_ENV=production bundle exec jekyll build -d #{dir}"
cd dir do
current_time = Time.now.strftime("%Y-%m-%d %H:%M:%S")
system "touch .nojekyll"
system "touch CNAME"
system "echo future.js.org > CNAME"
system "git add -A"
system "git commit -m 'build: generate on #{current_time}'"
system "git push origin gh-pages"
end
end