Files
Mathew 1d2c48cb93
Deploy / deploy (push) Successful in 1m3s
Renomme le jeu en Emberwild + déploiement Gitea Actions
- Jeu « Project One » → « Emberwild » (slug `emberwild`) dans lib/games.ts
  et toutes les références (accueil, devblog, README)
- Photo d'équipe (CEO/dev) câblée sur /image/teams/CEO_Dev.jpg
- CI/CD porté de GitHub Actions vers Gitea Actions
  (.gitea/workflows/deploy.yml) : build + déploiement auto au push sur master
- deploy.sh : déploiement manuel de secours

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 20:48:41 +02:00

46 lines
1.4 KiB
Bash

#!/usr/bin/env bash
# Déploiement du site Highland Games Studio / Emberwild sur le serveur Hetzner.
#
# Usage (depuis la racine du projet, dans Git Bash) :
# ./deploy.sh
#
# Ce que ça fait : archive le code (sans node_modules/.next/.git), l'envoie sur
# le serveur, installe les dépendances, build en prod et redémarre PM2.
set -euo pipefail
# --- Config serveur ---
SERVER="root@167.233.134.148"
KEY="$HOME/.ssh/id_rsa"
REMOTE_DIR="/var/www/highland"
APP_NAME="highland"
# Archive créée HORS du projet (sinon tar voit le dossier changer pendant la lecture).
TAR="${TMPDIR:-/tmp}/highland-deploy-$$.tar.gz"
cd "$(dirname "$0")"
echo "==> 1/3 Archive du projet..."
tar --exclude='./node_modules' --exclude='./.next' --exclude='./.git' \
--exclude='./tsconfig.tsbuildinfo' \
-czf "$TAR" .
echo "==> 2/3 Envoi vers le serveur ($SERVER)..."
scp -i "$KEY" -o BatchMode=yes "$TAR" "$SERVER:/tmp/site.tar.gz"
echo "==> 3/3 Extraction + build + redémarrage..."
ssh -i "$KEY" -o BatchMode=yes "$SERVER" \
"REMOTE_DIR='$REMOTE_DIR' APP_NAME='$APP_NAME' bash -s" <<'REMOTE'
set -e
mkdir -p "$REMOTE_DIR"
tar -xzf /tmp/site.tar.gz -C "$REMOTE_DIR"
cd "$REMOTE_DIR"
npm ci
npm run build
pm2 restart "$APP_NAME" --update-env || pm2 start npm --name "$APP_NAME" -- start
pm2 save
rm -f /tmp/site.tar.gz
REMOTE
rm -f "$TAR"
echo ""
echo "==> ✅ Déployé ! → https://highlandgamesstudio.com"