Merge pull request #3 from kazu634/prep-for-production

Prep for production
This commit is contained in:
Kazuhiro MUSASHI 2023-01-15 21:51:34 +09:00 committed by GitHub
commit 0f84695c76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View File

@ -3,7 +3,7 @@
# https://blowfish.page/docs/getting-started/
theme = "blowfish"
baseURL = "https://everun.club/"
baseURL = "https://www.everun.club/"
defaultContentLanguage = "ja"
hasCJKLanguage = true

18
tasks/production.rake Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env rake
require 'find'
desc 'Deploy the hugo contents to the server'
task :prod => [ :prep ] do
sh 'hugo -e production -v --minify'
sh 'find public -type f -name "*.gz" -delete'
sh 'find public/ -type f | egrep "\.(css|js|png|jpg|html|JPG|PNG|CSS|JS|HTML)$" | xargs -n 1 -i% -P 0 sh -c "cp % %.bk && gzip % && mv %.bk %"'
sh 'ssh -p 10022 webadm@10.0.1.166 "rm -rf /var/www/everun/*"'
sh 'rsync -e "ssh -p 10022" -rltvz --omit-dir-times --delete public/ webadm@10.0.1.166:/var/www/everun'
sh 'ssh -p 10022 webadm@10.0.1.166 "rm -rf /home/webadm/works/everun/*"'
sh 'rsync -e "ssh -p 10022" -rltvz --omit-dir-times --delete public/ webadm@10.0.1.166:/home/webadm/works/everun'
end