al-quran.reflectslight.io/tasks/deploy.rake

28 lines
709 B
Ruby
Raw Normal View History

2023-03-25 12:02:55 +01:00
##
# frozen_string_literal: true
desc "Configure environment for deployment"
task "deploy:env" do
2024-02-18 22:02:16 +01:00
ENV["buildenv"] = "production"
print "Set $NODE_ENV to 'production'", "\n"
2023-03-25 12:02:55 +01:00
end
desc "Deploy the website"
task "deploy" => %i[deploy:env nanoc:clean nanoc:compile] do
2023-03-25 12:53:22 +01:00
git_branch = `git branch --show-current`.chomp
if git_branch != "production"
2023-07-23 19:01:24 +02:00
warn "This task must be run on the 'production' branch."
2023-03-25 12:53:22 +01:00
exit(1)
end
print "Wait...", "\n"
sh(
2023-07-13 02:31:54 +02:00
"rsync",
"--delete", "-rvah",
"--chmod=Fu=r,Fg=r,Du=rx,Dg=rx",
2023-03-25 12:53:22 +01:00
"--rsync-path='/home/0x1eef/rsync.sh'",
2023-07-13 02:31:54 +02:00
"--exclude=audio/",
"build/al-quran/",
"0x1eef@al-quran.reflectslight.io:/mnt/www/al-quran.reflectslight.io/"
2023-03-25 12:53:22 +01:00
)
end