-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.bat
More file actions
60 lines (52 loc) · 1.76 KB
/
deploy.bat
File metadata and controls
60 lines (52 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
@echo off
REM Script de despliegue para Vercel (Windows)
REM Uso: deploy.bat
echo 🚀 Iniciando despliegue a Vercel...
REM Verificar que estamos en la rama correcta
for /f "tokens=*" %%i in ('git branch --show-current') do set CURRENT_BRANCH=%%i
if not "%CURRENT_BRANCH%"=="main" (
echo ❌ Debes estar en la rama 'main'. Rama actual: %CURRENT_BRANCH%
exit /b 1
)
REM Verificar que el directorio pkg/ existe y tiene archivos WebAssembly
if not exist "pkg" (
echo 📦 Directorio pkg/ no encontrado, compilando WebAssembly...
npm run build-wasm
if errorlevel 1 (
echo ❌ Error al compilar WebAssembly
exit /b 1
)
) else if not exist "pkg\atomic_particles_simulation_bg.wasm" (
echo 📦 Archivo WebAssembly no encontrado, compilando...
npm run build-wasm
if errorlevel 1 (
echo ❌ Error al compilar WebAssembly
exit /b 1
)
)
REM Verificar que no hay cambios sin committear
git status --porcelain >nul 2>&1
if errorlevel 1 (
echo ⚠️ Hay cambios sin committear. Añadiéndolos...
git add .
git commit -m "Auto-commit before deployment"
)
REM Hacer push para activar el despliegue automático
echo 📤 Subiendo cambios a GitHub...
git push origin main
if errorlevel 1 (
echo ❌ Error al subir cambios a GitHub
exit /b 1
) else (
echo ✅ Cambios subidos exitosamente a GitHub
echo.
echo 🌍 Vercel debería detectar los cambios automáticamente y hacer el despliegue.
echo Monitorea el progreso en: https://vercel.com/dashboard
echo.
echo 📱 Una vez completado, tu aplicación estará disponible en:
echo https://ia-atomic-particles.vercel.app
echo.
echo ⏱️ El proceso puede tomar 2-5 minutos.
)
echo 🎉 ¡Despliegue iniciado exitosamente!
pause