fix ci-cd
Some checks failed
Deploy triz-docs to civital server / build-and-deploy (push) Failing after 1h8m6s

This commit is contained in:
Othmane Ataallah 2026-04-28 11:57:24 +01:00
parent 8df8c91454
commit 57d4e73e55

View File

@ -41,9 +41,10 @@ jobs:
# -------------------------------------------------- # --------------------------------------------------
# 3. Install dependencies # 3. Install dependencies
# - No conditional rmdir (was causing silent abort) # - No echo+command chaining with & (triggers runner's
# - Prints CWD and directory listing so we can see # implicit error check on some Gitea act_runner versions)
# exactly what npm ci is working with # - npm install instead of npm ci: works even if
# package-lock.json is missing or outdated
# -------------------------------------------------- # --------------------------------------------------
- name: Install dependencies - name: Install dependencies
if: success() if: success()
@ -51,22 +52,25 @@ jobs:
run: | run: |
set PATH=%NODE_PATH%;%PATH% set PATH=%NODE_PATH%;%PATH%
cd /d "%WORKSPACE_DIR%" cd /d "%WORKSPACE_DIR%"
echo [diag] Working dir: %CD% echo [diag] Working dir:
echo [diag] Node: & node --version echo %CD%
echo [diag] npm: & npm --version echo [diag] Node version:
echo [diag] Files in workspace: node --version
dir /B "%WORKSPACE_DIR%" echo [diag] npm version:
echo [diag] Running npm ci... npm --version
npm ci 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% if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
echo [diag] npm ci done. Contents of node_modules\.bin: echo [diag] Checking docusaurus installed:
dir /B "%WORKSPACE_DIR%\node_modules\.bin" if exist "node_modules\.bin\docusaurus.cmd" (echo YES) else (echo NO - ABORTING && exit /b 1)
echo [diag] Install complete.
# -------------------------------------------------- # --------------------------------------------------
# 4. Build # 4. Build
# Calls node directly — avoids .cmd resolution and # npx finds the local docusaurus binary automatically —
# PATH issues entirely. Works even if node_modules\.bin # no hardcoded paths, no PATH resolution needed
# is not in PATH at all.
# -------------------------------------------------- # --------------------------------------------------
- name: Build - name: Build
if: success() if: success()
@ -74,11 +78,10 @@ jobs:
run: | run: |
set PATH=%NODE_PATH%;%PATH% set PATH=%NODE_PATH%;%PATH%
cd /d "%WORKSPACE_DIR%" cd /d "%WORKSPACE_DIR%"
echo [diag] Starting build via node... echo [diag] Starting Docusaurus build...
node "%WORKSPACE_DIR%\node_modules\@docusaurus\core\bin\docusaurus.js" build npx docusaurus build
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
echo [diag] Build output: echo [diag] Build complete.
dir /B "%WORKSPACE_DIR%\build"
# -------------------------------------------------- # --------------------------------------------------
# 5. Deploy # 5. Deploy