From 8df8c91454893be6526f06675f7d269f42618617 Mon Sep 17 00:00:00 2001 From: Othmane Ataallah <”othmane.ataallah.triztech@gmail.com”> Date: Tue, 28 Apr 2026 11:28:48 +0100 Subject: [PATCH] fix ci-cd --- .gitea/workflows/deploy.yml | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index fd75d11..c32fd1a 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -41,9 +41,9 @@ jobs: # -------------------------------------------------- # 3. Install dependencies - # Force-remove any node_modules committed to the repo - # before installing — they would be Linux binaries - # that don't work on Windows + # - No conditional rmdir (was causing silent abort) + # - Prints CWD and directory listing so we can see + # exactly what npm ci is working with # -------------------------------------------------- - name: Install dependencies if: success() @@ -51,25 +51,22 @@ jobs: run: | set PATH=%NODE_PATH%;%PATH% cd /d "%WORKSPACE_DIR%" - echo [diag] Node and npm versions: - node --version - npm --version - echo [diag] Removing any committed node_modules... - if exist "node_modules" rmdir /S /Q "node_modules" + echo [diag] Working dir: %CD% + echo [diag] Node: & node --version + echo [diag] npm: & npm --version + echo [diag] Files in workspace: + dir /B "%WORKSPACE_DIR%" echo [diag] Running npm ci... npm ci if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% - echo [diag] Verifying docusaurus binary exists: - if not exist "node_modules\.bin\docusaurus.cmd" ( - echo ERROR: docusaurus.cmd not found in node_modules\.bin - exit /b 1 - ) - echo [diag] Install complete. + echo [diag] npm ci done. Contents of node_modules\.bin: + dir /B "%WORKSPACE_DIR%\node_modules\.bin" # -------------------------------------------------- # 4. Build - # Call docusaurus.cmd directly — avoids all PATH - # resolution issues with npm run on Windows + # Calls node directly — avoids .cmd resolution and + # PATH issues entirely. Works even if node_modules\.bin + # is not in PATH at all. # -------------------------------------------------- - name: Build if: success() @@ -77,10 +74,10 @@ jobs: run: | set PATH=%NODE_PATH%;%PATH% cd /d "%WORKSPACE_DIR%" - echo [diag] Starting Docusaurus build... - call "%WORKSPACE_DIR%\node_modules\.bin\docusaurus.cmd" build + echo [diag] Starting build via node... + node "%WORKSPACE_DIR%\node_modules\@docusaurus\core\bin\docusaurus.js" build if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% - echo [diag] Build complete. Output: + echo [diag] Build output: dir /B "%WORKSPACE_DIR%\build" # --------------------------------------------------