fix ci-cd
Some checks failed
Deploy triz-docs to civital server / build-and-deploy (push) Failing after 1h8m55s
Some checks failed
Deploy triz-docs to civital server / build-and-deploy (push) Failing after 1h8m55s
This commit is contained in:
parent
767b400fdb
commit
e2cc3f2de6
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user