Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,24 @@ fi
echo "✅ pnpm found: $(which pnpm)"
echo "✅ pnpm version: $(pnpm -v)"

# Install/Update dependencies (cần devDependencies để build)
# Install/Update dependencies (chỉ cần production dependencies vì dist/ đã được copy từ GitHub Actions)
echo "📦 Installing dependencies..."
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile --prod

# Build application (luôn build để đảm bảo có code mới nhất)
echo "🔨 Building application..."
pnpm run build

# Kiểm tra build thành công
# Kiểm tra dist/ đã được copy từ GitHub Actions
if [ ! -f "dist/main.js" ]; then
echo "❌ Build failed: dist/main.js not found"
exit 1
echo "⚠️ dist/main.js not found, building from source..."
# Chỉ build nếu dist/ không có (fallback)
pnpm install --frozen-lockfile
pnpm run build
if [ ! -f "dist/main.js" ]; then
echo "❌ Build failed: dist/main.js not found"
exit 1
fi
echo "✅ Build completed successfully"
else
echo "✅ Using dist/ from GitHub Actions (no rebuild needed)"
fi
echo "✅ Build completed successfully"

# Run database migrations
echo "🗄️ Running database migrations..."
Expand Down
Loading