23 lines
600 B
Bash
23 lines
600 B
Bash
|
|
#!/usr/bin/env bash
|
||
|
|
# Deploy furtka.org to forge-runner-01.
|
||
|
|
# Rsyncs the Hugo source up to the VM and builds it in-place.
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
HOST="${FURTKA_HOST:-forge-runner}"
|
||
|
|
SRCROOT="/srv/furtka-site"
|
||
|
|
WEBROOT="/var/www/furtka.org"
|
||
|
|
|
||
|
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
||
|
|
|
||
|
|
echo "→ rsync website/ to $HOST:$SRCROOT"
|
||
|
|
rsync -az --delete \
|
||
|
|
--exclude='.hugo_build.lock' \
|
||
|
|
--exclude='public/' \
|
||
|
|
--exclude='resources/' \
|
||
|
|
"$HERE/" "$HOST:$SRCROOT/"
|
||
|
|
|
||
|
|
echo "→ build on $HOST"
|
||
|
|
ssh "$HOST" "cd $SRCROOT && hugo --minify --cleanDestinationDir -d $WEBROOT"
|
||
|
|
|
||
|
|
echo "OK: deployed to https://furtka.org/"
|