Files
snatchgame/push-remotes.sh
josedario87 fa94330ace
Some checks failed
build-and-deploy / build (push) Failing after 6s
build-and-deploy / deploy (push) Has been skipped
Organizar archivos de deployment en carpeta deploy/
2025-08-15 17:50:33 -06:00

34 lines
1.0 KiB
Bash

#!/bin/bash
# Script para hacer push a ambos remotes con diferentes .gitignore
echo "Pushing to Gitea (with deploy folder)..."
# Para Gitea: usar .gitignore normal (incluye deploy/)
git add -A
git commit -m "${1:-Update deployment}" || echo "No changes to commit"
git push gitea main
echo "Pushing to GitHub (without deploy folder)..."
# Para GitHub: usar .gitignore que excluye deploy/
if [ -f .gitignore.github ]; then
# Backup actual .gitignore
cp .gitignore .gitignore.backup
# Usar .gitignore específico para GitHub
cp .gitignore.github .gitignore
# Hacer push sin deploy/
git add .gitignore
git rm -r --cached deploy/ 2>/dev/null || true
git commit -m "${1:-Update without deploy folder}" || echo "No changes to commit"
git push origin main
# Restaurar .gitignore original
cp .gitignore.backup .gitignore
git add .gitignore
git commit -m "Restore gitignore" || echo "No changes to commit"
else
echo "No .gitignore.github found, skipping GitHub push"
fi
echo "Done!"