-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
32 lines (29 loc) · 815 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
desc "Build the website from source"
task :build do
puts "## Building website"
status = system("bundle exec middleman build --clean")
puts status ? "OK" : "FAILED"
end
desc "Run the preview server at http://localhost:4567"
task :preview do
system("middleman server")
end
desc "deploy to github pages"
task :deploy do
p "## Deploying to Github Pages"
cd "build" do
system "echo 'stevebrewer.uk' >> CNAME"
system "git add ."
message = "Site updated at #{Time.now.utc}"
p "## Commiting: #{message}"
system "git commit -m \"#{message}\""
p "## Pushing generated website"
system "git push origin master -f"
p "## Github Pages deploy complete"
end
end
desc "build and deploy to github pages"
task :publish do
Rake::Task["build"].invoke
Rake::Task["deploy"].invoke
end