Create staging deploy task.

This commit is contained in:
Kazuhiro MUSASHI 2019-06-29 16:25:33 +08:00
parent fc5d0a22c6
commit a93b333da9
1 changed files with 4 additions and 1 deletions

View File

@ -3,12 +3,15 @@
require 'find'
desc 'Deploy the hugo contents to the server'
task :deploy => [:build] do
task :stag => [:prep] do
sh 'hugo -e staging -v'
sh 'find public -type f -name "*.gz" -delete'
Find.find("#{Dir::pwd}/public") do |f|
if f =~ /\.(css|js|png|jpg|JPG|PNG|CSS|JS)$/ && FileTest.file?(f)
sh "gzip -c #{f} > #{f}.gz"
sh "rm #{f}"
end
end