Files
env-docker/Config/HugoExample/files/hugo.cronjob.sh

12 lines
192 B
Bash

#!/usr/bin/env bash
cd /var/www/hugo/site
git pull && hugo --gc --minify
status="$?"
if [[ $status == 0 && -e public/* ]]; then
rm -rfv /var/www/html/*
mv -rfv public/* /var/www/html/
fi