From 7c9ff5308f7750b760d7c5e671d225513714374a Mon Sep 17 00:00:00 2001 From: Resistencia Dev Date: Sat, 13 Dec 2025 15:38:03 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20Instalaci=C3=B3n=20manual=20de=20Node.j?= =?UTF-8?q?s=20en=20el=20runner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .gitea/workflows/deployment.yml | 39 ++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 45edbb2..1ac5324 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -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