Wire CI/CD (Gitea Actions typecheck) and daily Postgres backup
CI / typecheck (push) Failing after 1m57s

- .gitea/workflows/ci.yml runs pnpm typecheck on the already-registered
  forge-runner on push/PR to main
- scripts/backup-db.sh + a systemd user timer (stock-app-backup.timer, daily)
  pg_dump the stocklist Postgres container to ~/backups, pruned to 14 days
This commit is contained in:
exe.dev user
2026-07-29 12:20:35 +00:00
parent e859245867
commit 5b17f7e2c8
2 changed files with 34 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Daily pg_dump of the stocklist Postgres container, run by the
# stock-app-backup systemd timer. Keeps the last 14 days of backups.
set -euo pipefail
BACKUP_DIR="$HOME/backups/stocklist-postgres"
mkdir -p "$BACKUP_DIR"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
OUT_FILE="$BACKUP_DIR/stocklist-$TIMESTAMP.sql.gz"
docker exec stocklist-postgres pg_dump -U stocklist stocklist | gzip > "$OUT_FILE"
find "$BACKUP_DIR" -name '*.sql.gz' -mtime +14 -delete
echo "Backed up stocklist database to $OUT_FILE"