-
Notifications
You must be signed in to change notification settings - Fork 45
/
Rakefile
33 lines (25 loc) · 915 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
33
require 'middleman-gh-pages'
task :lint_projects do
# TODO. See: https://github.com/chriseidhof/ios-videos/blob/89a5c6364254e03e16196c78c51653e56bab2df9/Rakefile#L21-L35 for example
end
desc "Performs CI deploy if on source branch"
task :travis do
branch = ENV['TRAVIS_BRANCH']
pull_request = ENV['TRAVIS_PULL_REQUEST']
abort 'Must be run on Travis' unless branch
if pull_request != 'false'
puts 'Skipping deploy for pull request; can only be deployed from source branch.'
exit 0
end
if branch != 'source'
puts "Skipping deploy for #{ branch }; can only be deployed from source branch."
exit 0
end
sh "rake deploy"
end
desc "Builds, then publishes"
task :deploy do
sh "./scripts/github_fetch.rb" # Fetch GitHub-info and populate items.yml
sh "bundle exec rake publish BRANCH_NAME=master ALLOW_DIRTY=true" # Build & Deploy
end
task :default => [:lint_projects, :travis]