From 4251b1f40bdf8a597c32cd92e4f8d1728f5bbcff Mon Sep 17 00:00:00 2001 From: Brummel Date: Thu, 21 May 2026 12:47:23 +0200 Subject: [PATCH] chore(deploy): add simple build+rsync deploy script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wraps the build-and-push routine (zola build → rsync to mycelium:~/public/praxis/) with --dry-run and --no-build flags. Anchored to repo root via $(dirname). --- scripts/deploy.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 scripts/deploy.sh diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100755 index 0000000..eff94db --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# Build the Zola site and sync `public/` to the Variomedia staging host. +# +# Usage: +# scripts/deploy.sh # build + deploy +# scripts/deploy.sh --dry-run # show what rsync would do, transfer nothing +# scripts/deploy.sh --no-build # skip `zola build` (deploy existing public/) + +set -euo pipefail + +REMOTE="mycelium:~/public/praxis/" +LOCAL="public/" + +# Run from the repo root so relative paths are stable. +cd "$(dirname "$0")/.." + +DRY_RUN="" +DO_BUILD=1 +for arg in "$@"; do + case "$arg" in + --dry-run) DRY_RUN="--dry-run" ;; + --no-build) DO_BUILD=0 ;; + -h|--help) + sed -n '2,8p' "$0" + exit 0 ;; + *) + echo "unknown flag: $arg" >&2 + exit 2 ;; + esac +done + +if [[ "$DO_BUILD" -eq 1 ]]; then + echo "==> zola build" + zola build +fi + +if [[ ! -d "$LOCAL" ]]; then + echo "error: $LOCAL does not exist — run without --no-build first" >&2 + exit 1 +fi + +echo "==> rsync $LOCAL -> $REMOTE${DRY_RUN:+ (dry-run)}" +rsync -avz --delete $DRY_RUN "$LOCAL" "$REMOTE" + +echo "==> done"