feat: Instalación manual de Node.js en el runner
Some checks failed
CI/CD - Francia Ocupada (La Resistencia) / build-and-deploy (push) Failing after 7s

- Agregado paso para instalar Node.js usando comandos del sistema
- Soporta Debian/Ubuntu, RedHat/CentOS, Alpine Linux
- Fallback a nvm para otros sistemas
- Necesario porque el runner no tiene Node.js preinstalado
- Las acciones de GitHub requieren Node.js para ejecutarse
This commit is contained in:
Resistencia Dev
2025-12-13 15:38:03 +01:00
parent 0211dfb68b
commit 7c9ff5308f

View File

@@ -18,11 +18,40 @@ jobs:
runs-on: [production-ready]
steps:
# PASO 1: Configurar Node.js (necesario para ejecutar las acciones de checkout)
- name: ⚙️ Configurar Node.js (Necesario para las acciones)
uses: actions/setup-node@v4
with:
node-version: '20'
# PASO 1: Instalar Node.js manualmente (requerido por las acciones de GitHub)
- name: 📦 Instalar Node.js
run: |
echo "Verificando si Node.js está instalado..."
if ! command -v node &> /dev/null; then
echo "Node.js no encontrado, instalando..."
# Detectar el sistema operativo
if [ -f /etc/debian_version ]; then
# Debian/Ubuntu
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
elif [ -f /etc/redhat-release ]; then
# RedHat/CentOS/Fedora
curl -fsSL https://rpm.nodesource.com/setup_20.x | bash -
yum install -y nodejs
elif [ -f /etc/alpine-release ]; then
# Alpine Linux
apk add --no-cache nodejs npm
else
echo "Sistema operativo no soportado, intentando instalación genérica..."
# Intentar con nvm como fallback
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install 20
fi
else
echo "Node.js ya está instalado: $(node --version)"
fi
# Verificar instalación
node --version
npm --version
# PASO 2: Checkout del Código
- name: 🚀 Checkout del Código