fix ci-cd
Some checks failed
Deploy triz-docs to civital server / build-and-deploy (push) Failing after 1h8m5s
Some checks failed
Deploy triz-docs to civital server / build-and-deploy (push) Failing after 1h8m5s
This commit is contained in:
parent
5208d65fa8
commit
7510e3728b
@ -9,13 +9,10 @@ jobs:
|
||||
runs-on: serveurtest150
|
||||
|
||||
env:
|
||||
# === PROJECT ===
|
||||
GIT_REPO_URL: 145.239.66.197:3000/TrizTech/triz-docs.git
|
||||
BRANCH: main
|
||||
# === WORKSPACE ===
|
||||
WORKSPACE_DIR: C:\CICD\workspace\triz-docs
|
||||
DEPLOY_DIR: C:\inetpub\wwwroot\docs
|
||||
# === NODE — adjust this path if your Node.js is installed elsewhere ===
|
||||
NODE_PATH: C:\Program Files\nodejs
|
||||
|
||||
steps:
|
||||
@ -31,9 +28,7 @@ jobs:
|
||||
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
|
||||
|
||||
# --------------------------------------------------
|
||||
# 2. Shallow clone
|
||||
# -c credential.helper= disables Git Credential Manager
|
||||
# entirely for this command — credentials come from the URL only
|
||||
# 2. Shallow clone — credential helper disabled
|
||||
# --------------------------------------------------
|
||||
- name: Clone source code
|
||||
if: success()
|
||||
@ -46,6 +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
|
||||
# --------------------------------------------------
|
||||
- name: Install dependencies
|
||||
if: success()
|
||||
@ -53,29 +51,40 @@ jobs:
|
||||
run: |
|
||||
set PATH=%NODE_PATH%;%PATH%
|
||||
cd /d "%WORKSPACE_DIR%"
|
||||
echo [diag] Node and npm versions:
|
||||
node --version
|
||||
npm --version
|
||||
npm ci --loglevel warn
|
||||
echo [diag] Removing any committed node_modules...
|
||||
if exist "node_modules" rmdir /S /Q "node_modules"
|
||||
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.
|
||||
|
||||
# --------------------------------------------------
|
||||
# 4. Build Docusaurus static site
|
||||
# node_modules\.bin is added explicitly because
|
||||
# npm run does not reliably inject it in cmd on Windows
|
||||
# 4. Build
|
||||
# Call docusaurus.cmd directly — avoids all PATH
|
||||
# resolution issues with npm run on Windows
|
||||
# --------------------------------------------------
|
||||
- name: Build
|
||||
if: success()
|
||||
shell: cmd
|
||||
run: |
|
||||
set PATH=%NODE_PATH%;%NODE_PATH%\node_modules\npm\bin;%WORKSPACE_DIR%\node_modules\.bin;%PATH%
|
||||
set PATH=%NODE_PATH%;%PATH%
|
||||
cd /d "%WORKSPACE_DIR%"
|
||||
npm run build
|
||||
echo [diag] Starting Docusaurus build...
|
||||
call "%WORKSPACE_DIR%\node_modules\.bin\docusaurus.cmd" build
|
||||
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
|
||||
echo [diag] Build complete. Output:
|
||||
dir /B "%WORKSPACE_DIR%\build"
|
||||
|
||||
# --------------------------------------------------
|
||||
# 5. Deploy
|
||||
# /E = include subdirectories (even empty ones)
|
||||
# /PURGE = remove destination files absent from source
|
||||
# --------------------------------------------------
|
||||
- name: Deploy
|
||||
if: success()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user