From e2cc3f2de66851ecc9a87d0de9eac45c26ae8c99 Mon Sep 17 00:00:00 2001 From: Othmane Ataallah <”othmane.ataallah.triztech@gmail.com”> Date: Tue, 28 Apr 2026 13:28:24 +0100 Subject: [PATCH] fix ci-cd --- .gitea/workflows/deploy.yml | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 4c3e7ab..4f17747 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -28,10 +28,9 @@ jobs: if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% # -------------------------------------------------- - # 2. Shallow clone — credential helper disabled + # 2. Clone source code # -------------------------------------------------- - name: Clone source code - if: success() shell: cmd env: GIT_TOKEN: ${{ secrets.GITEAACTTOKEN }} @@ -41,39 +40,22 @@ jobs: # -------------------------------------------------- # 3. Install dependencies - # - 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() shell: cmd run: | set PATH=%NODE_PATH%;%PATH% cd /d "%WORKSPACE_DIR%" - 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] 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 - # npx finds the local docusaurus binary automatically — - # no hardcoded paths, no PATH resolution needed # -------------------------------------------------- - name: Build - if: success() shell: cmd run: | set PATH=%NODE_PATH%;%PATH% @@ -84,25 +66,24 @@ jobs: exit /b 1 ) - echo [diag] Starting Docusaurus build... npm run build if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% - echo [diag] Build complete. # -------------------------------------------------- # 5. Deploy # -------------------------------------------------- - name: Deploy - if: success() shell: cmd run: | if not exist "%DEPLOY_DIR%" mkdir "%DEPLOY_DIR%" + robocopy "%WORKSPACE_DIR%\build" "%DEPLOY_DIR%" /E /PURGE /NFL /NDL /NJH /NJS + if %ERRORLEVEL% gtr 7 exit /b %ERRORLEVEL% # -------------------------------------------------- - # 6. Always clean up + # 6. Cleanup # -------------------------------------------------- - name: Cleanup workspace if: always()