From a93b333da98b882c807afed1ae66723507416892 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sat, 29 Jun 2019 16:25:33 +0800 Subject: [PATCH] Create staging deploy task. --- tasks/{deploy.rake => staging.rake} | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) rename tasks/{deploy.rake => staging.rake} (86%) diff --git a/tasks/deploy.rake b/tasks/staging.rake similarity index 86% rename from tasks/deploy.rake rename to tasks/staging.rake index 12fc496..1dc18b5 100644 --- a/tasks/deploy.rake +++ b/tasks/staging.rake @@ -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