From 57d4e73e55df3c979e58721e7db61b720990dd71 Mon Sep 17 00:00:00 2001 From: Othmane Ataallah <”othmane.ataallah.triztech@gmail.com”> Date: Tue, 28 Apr 2026 11:57:24 +0100 Subject: [PATCH] fix ci-cd --- .gitea/workflows/deploy.yml | 41 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index c32fd1a..136323b 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -41,9 +41,10 @@ jobs: # -------------------------------------------------- # 3. Install dependencies - # - No conditional rmdir (was causing silent abort) - # - Prints CWD and directory listing so we can see - # exactly what npm ci is working with + # - No echo+command chaining with & (triggers runner's + # implicit error check on some Gitea act_runner versions) + # - npm install instead of npm ci: works even if + # package-lock.json is missing or outdated # -------------------------------------------------- - name: Install dependencies if: success() @@ -51,22 +52,25 @@ jobs: run: | set PATH=%NODE_PATH%;%PATH% cd /d "%WORKSPACE_DIR%" - 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 + echo [diag] Working dir: + echo %CD% + echo [diag] Node version: + node --version + echo [diag] npm version: + npm --version + echo [diag] package.json present: + if exist "package.json" (echo YES) else (echo NO - ABORTING && exit /b 1) + echo [diag] Running npm install... + npm install if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% - echo [diag] npm ci done. Contents of node_modules\.bin: - dir /B "%WORKSPACE_DIR%\node_modules\.bin" + echo [diag] Checking docusaurus installed: + if exist "node_modules\.bin\docusaurus.cmd" (echo YES) else (echo NO - ABORTING && exit /b 1) + echo [diag] Install complete. # -------------------------------------------------- # 4. Build - # Calls node directly — avoids .cmd resolution and - # PATH issues entirely. Works even if node_modules\.bin - # is not in PATH at all. + # npx finds the local docusaurus binary automatically — + # no hardcoded paths, no PATH resolution needed # -------------------------------------------------- - name: Build if: success() @@ -74,11 +78,10 @@ jobs: run: | set PATH=%NODE_PATH%;%PATH% cd /d "%WORKSPACE_DIR%" - echo [diag] Starting build via node... - node "%WORKSPACE_DIR%\node_modules\@docusaurus\core\bin\docusaurus.js" build + echo [diag] Starting Docusaurus build... + npx docusaurus build if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% - echo [diag] Build output: - dir /B "%WORKSPACE_DIR%\build" + echo [diag] Build complete. # -------------------------------------------------- # 5. Deploy