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

This commit is contained in:
Othmane Ataallah 2026-04-28 11:17:33 +01:00
parent 1290f4a359
commit 5208d65fa8
2 changed files with 4 additions and 68 deletions

View File

@ -46,8 +46,6 @@ jobs:
# -------------------------------------------------- # --------------------------------------------------
# 3. Install dependencies # 3. Install dependencies
# PATH is extended here so npm is always found
# regardless of how the runner account was set up
# -------------------------------------------------- # --------------------------------------------------
- name: Install dependencies - name: Install dependencies
if: success() if: success()
@ -57,17 +55,19 @@ jobs:
cd /d "%WORKSPACE_DIR%" cd /d "%WORKSPACE_DIR%"
node --version node --version
npm --version npm --version
npm ci npm ci --loglevel warn
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
# -------------------------------------------------- # --------------------------------------------------
# 4. Build Docusaurus static site # 4. Build Docusaurus static site
# node_modules\.bin is added explicitly because
# npm run does not reliably inject it in cmd on Windows
# -------------------------------------------------- # --------------------------------------------------
- name: Build - name: Build
if: success() if: success()
shell: cmd shell: cmd
run: | run: |
set PATH=%NODE_PATH%;%PATH% set PATH=%NODE_PATH%;%NODE_PATH%\node_modules\npm\bin;%WORKSPACE_DIR%\node_modules\.bin;%PATH%
cd /d "%WORKSPACE_DIR%" cd /d "%WORKSPACE_DIR%"
npm run build npm run build
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%

View File

@ -1,64 +0,0 @@
name: Deploy triz-docs to civital server test
on:
push:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: trizservicetest
env:
# === PROJECT ===
GIT_REPO_URL: 145.239.66.197:3000/TrizTech/triz-docs.git
BRANCH: main
GIT_TOKEN: ${{ secrets.GITEAACTTOKEN }}
# === WORKSPACE ===
WORKSPACE_DIR: C:\CICD\workspace
steps:
# --------------------------------------------------
# 1. Prepare clean workspace (no source kept)
# --------------------------------------------------
- name: Prepare workspace
shell: cmd
run: |
if exist %WORKSPACE_DIR% rmdir /S /Q %WORKSPACE_DIR%
mkdir %WORKSPACE_DIR%
# --------------------------------------------------
# 2. Clone source (shallow, fast) --depth 1 -b %BRANCH%
# --------------------------------------------------
- name: Clone source code
shell: cmd
run: |
cd %WORKSPACE_DIR%
git clone --depth 1 --branch %BRANCH% http://ciRunner:%GIT_TOKEN%@%GIT_REPO_URL% .
- name: Install deps
run: |
cd %WORKSPACE_DIR%
npm ci
- name: Build
run: |
cd %WORKSPACE_DIR%
npm run build
- name: Deploy
run: |
cd %WORKSPACE_DIR%
rm -rf /var/www/docs/*
cp -r build/* /var/www/docs/
# --------------------------------------------------
# 10. Cleanup source code (no trace left)
# --------------------------------------------------
- name: Cleanup workspace
if: always()
shell: cmd
run: |
rmdir /S /Q %WORKSPACE_DIR%