Reiseblog mit CMS
This commit is contained in:
commit
7f820a6478
19 changed files with 600 additions and 0 deletions
24
deploy/forgejo-post-receive.sh
Normal file
24
deploy/forgejo-post-receive.sh
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
# Forgejo Build-Hook für die Umgebung mit Apache.
|
||||
# Eintragen unter: Repo -> Einstellungen -> Git-Hooks -> post-receive.
|
||||
# (Voraussetzung: Admin hat Git-Hooks aktiviert, siehe Anleitung.)
|
||||
#
|
||||
# Ablauf: Code auschecken -> bauen -> Ergebnis in den Apache-DocumentRoot kopieren.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
WORKTREE=/srv/sattelfest # Arbeits-/Build-Verzeichnis (Quellcode)
|
||||
PUBLISH=/var/www/sattelfest # Apache DocumentRoot (fertige Website)
|
||||
|
||||
export PATH="/usr/local/bin:/usr/bin:/bin:$PATH"
|
||||
|
||||
git --work-tree="$WORKTREE" checkout -f main
|
||||
|
||||
cd "$WORKTREE"
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
# Fertige Dateien in den DocumentRoot spiegeln (--delete entfernt Altes).
|
||||
rsync -a --delete "$WORKTREE/dist/" "$PUBLISH/"
|
||||
|
||||
echo "✅ Deploy fertig: $(date)"
|
||||
Loading…
Add table
Add a link
Reference in a new issue