-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
34 lines (26 loc) · 938 Bytes
/
deploy.sh
File metadata and controls
34 lines (26 loc) · 938 Bytes
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
#!/bin/bash
# Script para deploy a GitHub Pages
# Uso: ./deploy.sh
echo "🚀 Iniciando deploy a GitHub Pages..."
# Build del proyecto
echo "📦 Construyendo proyecto..."
npm run build
# Crear archivo .nojekyll si no existe
if [ ! -f "out/.nojekyll" ]; then
echo "📝 Creando archivo .nojekyll..."
touch out/.nojekyll
fi
# Verificar si git está inicializado
if [ ! -d ".git" ]; then
echo "⚠️ Git no está inicializado. Inicializando..."
git init
fi
# Agregar cambios
echo "📝 Agregando cambios..."
git add out
git commit -m "Deploy to GitHub Pages" || echo "⚠️ No hay cambios para commitear"
# Push a gh-pages
echo "🚀 Desplegando a GitHub Pages..."
git subtree push --prefix out origin gh-pages || echo "⚠️ Error al hacer push. Asegúrate de tener la rama gh-pages configurada."
echo "✅ Deploy completado!"
echo "🌐 Tu sitio estará disponible en: https://tu-usuario.github.io/nombre-del-repo/"