feat: add deploy script

This commit is contained in:
Oleg Proskurin 2025-12-15 12:45:17 +07:00
parent 93defca7d2
commit d57bb2e3b9
2 changed files with 38 additions and 1 deletions

View File

@ -20,7 +20,9 @@
"test:api": "tsx tests/api/run-all.ts",
"format": "prettier --write \"apps/**/*.{ts,tsx,js,jsx,json,css,md}\" \"packages/**/*.{ts,tsx,js,jsx,json,css,md}\" \"*.{ts,tsx,js,jsx,json,css,md}\" --ignore-unknown",
"format:check": "prettier --check \"apps/**/*.{ts,tsx,js,jsx,json,css,md}\" \"packages/**/*.{ts,tsx,js,jsx,json,css,md}\" \"*.{ts,tsx,js,jsx,json,css,md}\" --ignore-unknown",
"clean": "pnpm -r clean && rm -rf node_modules"
"clean": "pnpm -r clean && rm -rf node_modules",
"deploy:landing": "./scripts/deploy-landing.sh",
"deploy:landing:no-cache": "./scripts/deploy-landing.sh --no-cache"
},
"keywords": [
"monorepo",

35
scripts/deploy-landing.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
set -e
echo "=== Banatie Landing Deployment ==="
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
# Pull latest code
echo "→ Pulling latest changes..."
cd "$PROJECT_DIR"
git pull
# Build
echo "→ Building landing..."
cd /opt/banatie
BUILD_ARGS=""
if [[ "$1" == "--no-cache" ]]; then
echo " (using --no-cache)"
BUILD_ARGS="--no-cache"
fi
docker compose --env-file .env --env-file secrets.env build $BUILD_ARGS banatie-landing
# Deploy
echo "→ Deploying..."
docker compose --env-file .env --env-file secrets.env up -d banatie-landing
# Check
sleep 3
echo "→ Status:"
docker logs banatie-landing --tail 5
echo "=== Done ==="