Create staging deploy task.
This commit is contained in:
parent
fc5d0a22c6
commit
a93b333da9
|
@ -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
|
||||
|
Loading…
Reference in New Issue