Reiseblog mit CMS
This commit is contained in:
commit
7f820a6478
19 changed files with 600 additions and 0 deletions
28
deploy/post-receive
Normal file
28
deploy/post-receive
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
# Git-Hook: läuft auf dem Server nach jedem "git push".
|
||||
# Checkt den Code aus und baut die statische Seite neu.
|
||||
#
|
||||
# Installation: nach /srv/git/sattelfest.git/hooks/post-receive kopieren
|
||||
# und ausführbar machen (chmod +x).
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
GIT_DIR_PATH=/srv/git/sattelfest.git
|
||||
WORKTREE=/srv/sattelfest
|
||||
BRANCH=main
|
||||
|
||||
# Node/npm (NodeSource installiert nach /usr/bin) auffindbar machen.
|
||||
export PATH="/usr/local/bin:/usr/bin:/bin:$PATH"
|
||||
|
||||
echo "→ Code auschecken …"
|
||||
git --git-dir="$GIT_DIR_PATH" --work-tree="$WORKTREE" checkout -f "$BRANCH"
|
||||
|
||||
cd "$WORKTREE"
|
||||
|
||||
echo "→ Abhängigkeiten installieren …"
|
||||
npm ci
|
||||
|
||||
echo "→ Seite bauen …"
|
||||
npm run build
|
||||
|
||||
echo "✅ Deploy fertig: $(date)"
|
||||
Loading…
Add table
Add a link
Reference in a new issue