Add deployment scripts for blog, links, notes, photos, and projects; implement history squashing and vision processing

- Created `publish-blog.sh`, `publish-links.sh`, `publish-notes.sh`, `publish-photos.sh`, and `publish-projects.sh` for deploying respective content to the VPS.
- Implemented `squash-history.sh` to replace the entire git history with a single commit.
- Added `vision.ts` and `vision.spec.ts` for processing images with AI, including metadata extraction and merging.
- Enhanced error handling and logging in vision processing scripts.
This commit is contained in:
Adrian Altner 2026-04-21 23:17:21 +02:00
parent a123886ee4
commit 0f43bb18cc
24 changed files with 2430 additions and 41 deletions

43
scripts/deploy.sh Executable file
View file

@ -0,0 +1,43 @@
#!/usr/bin/env bash
set -euo pipefail
VPS="${1:-hetzner}"
REMOTE_BRANCH="${2:-main}"
REMOTE_BASE='/opt/websites/adrian-altner.de'
# --- 1. Pull latest from repo ---
ssh "$VPS" "
set -euo pipefail
cd '$REMOTE_BASE'
git fetch --prune origin '$REMOTE_BRANCH'
git checkout '$REMOTE_BRANCH'
git reset --hard 'origin/$REMOTE_BRANCH'
git clean -fd -e .env -e .env.production
"
# --- 2. Build + deploy ---
ssh "$VPS" "
set -euo pipefail
cd '$REMOTE_BASE'
sudo podman build -t localhost/adrian-altner.de:latest .
sudo systemctl restart podman-compose@adrian-altner.de.service
sudo podman container prune -f 2>/dev/null || true
sudo podman image prune --external -f 2>/dev/null || true
sudo podman image prune -f 2>/dev/null || true
sudo podman builder prune -af 2>/dev/null || true
"
echo "Deploy done via $VPS (branch: $REMOTE_BRANCH)."
# --- 3. Webmentions ---
WEBMENTION_APP_TOKEN="$(ssh "$VPS" "grep '^WEBMENTION_APP_TOKEN=' '$REMOTE_BASE/.env.production' | cut -d= -f2-" 2>/dev/null || true)"
if [[ -n "$WEBMENTION_APP_TOKEN" ]]; then
echo "Sending webmentions via webmention.app..."
for feed in rss/blog.xml rss/fotos.xml; do
curl -s -X POST "https://webmention.app/check?url=https://adrian-altner.de/${feed}&token=${WEBMENTION_APP_TOKEN}" \
| grep -o '"status":"[^"]*"' || true
done
echo "Webmentions triggered."
else
echo "No WEBMENTION_APP_TOKEN in .env.production — skipping webmentions."
fi