-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.rb
26 lines (26 loc) · 1.04 KB
/
deploy.rb
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
repo = %x(git config remote.origin.url).gsub(/^git:/, 'https:')
deploy_branch = 'gh-pages'
if repo.match(/github\.com\.git$/)
deploy_branch = 'master'
end
system "git remote set-url --push origin #{repo}"
system "git remote set-branches --add origin #{deploy_branch}"
system 'git fetch -q'
system "git config user.name '#{ENV['GIT_NAME']}'"
system "git config user.email '#{ENV['GIT_EMAIL']}'"
system 'git config credential.helper "store --file=.git/credentials"'
File.open('.git/credentials', 'w') do |f|
f.write("https://#{ENV['GH_TOKEN']}:@github.com")
end
system "./build"
system "git add -f farsi-flash-cards.zip"
system "git commit -m \"Added latest packaged version\""
system "git push origin master"
system "git checkout gh-pages"
system "git merge master -m 'Updating Github Pages branch'"
system "./build"
system "git add -f farsi-flash-cards.zip"
system "git commit -m \"Added latest packaged version\""
system "git push origin gh-pages"
system "git checkout master"
File.delete '.git/credentials'