add the example scripts

This commit is contained in:
sakrecoer 2026-07-31 11:40:36 +02:00
parent 05016b454c
commit b74ca38c26
2 changed files with 56 additions and 0 deletions

20
exemple.deploy.sh Normal file
View file

@ -0,0 +1,20 @@
#!/bin/sh
# Configuration
SITE_DIR="/path/to/your-cloned-git"
WEBROOT="/probably/var/www/html"
LOG_FILE="$HOME/nostr-site-deploy.log"
date '+%Y-%m-%d %H:%M:%S' > $LOG_FILE # we wipe the log file from rpevious entries, because no history here is super important
cd $SITE_DIR
/usr/bin/git pull >> $LOG_FILE
/usr/bin/bash fetch-and-convert.sh >> $LOG_FILE
/snap/bin/hugo --cleanDestinationDir --minify >> $LOG_FILE
# Optional and potentially dangerous: the generator will creates a random file name (fingerprint) for css and js to be picked up when you do changes to it. If you don't remove them, over time your directory will bloat. A new file is only created if there are changes.
# This can be dangerous because if you set the webroot wrong, you're going to nuke stuff you wasn't supposed to.
#/usr/bin/rm $WEBROOT/css/*
#/usr/bin/rm $WEBROOT/js/*
/usr/bin/rsync -av $SITE_DIR $WEBROOT/ >> $LOG_FILE