-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
65 lines (49 loc) · 1.35 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# *************************************
#
# Rakefile
#
# *************************************
# -------------------------------------
# Requires
# -------------------------------------
require './lib/latest_blog_posts'
# -------------------------------------
# Namespace
# -------------------------------------
namespace :emails do
# ----- Latest Blog Posts ----- #
desc "Gets the current month's blog posts"
task :latest_blog_posts do
get_latest_blog_posts
end
end
# -------------------------------------
# Deploy
# -------------------------------------
# ----- Variables ----- #
REPO_URL = 'git@github.com:codeschool/emails.git'
# ----- Generate ----- #
desc 'Generate flat files with Middleman'
task :generate do
puts '-- Generating site with Middleman --'
system './bin/middleman build --clean'
cd 'build' do
system 'git init'
system "git remote add origin #{ REPO_URL }"
end
end
# ----- Push ----- #
desc 'Push the build to the gh-pages branch on GitHub'
task :push do
puts '-- Deploying build to GitHub Pages --'
cd 'build' do
system 'git add .'
system 'git add -u'
system "git commit -m 'Site updated at #{Time.now.utc}'"
system 'git push origin master:gh-pages --force'
end
end
# ----- Deploy ----- #
desc 'Generate flat files and deploy to GitHub Pages'
task :deploy => [:generate, :push] do
end