diff --git a/.gitea/workflows/pushMainTo150.yml b/.gitea/workflows/deploy.yml similarity index 92% rename from .gitea/workflows/pushMainTo150.yml rename to .gitea/workflows/deploy.yml index 6b6b0b8..52d6605 100644 --- a/.gitea/workflows/pushMainTo150.yml +++ b/.gitea/workflows/deploy.yml @@ -46,8 +46,6 @@ jobs: # -------------------------------------------------- # 3. Install dependencies - # PATH is extended here so npm is always found - # regardless of how the runner account was set up # -------------------------------------------------- - name: Install dependencies if: success() @@ -57,17 +55,19 @@ jobs: cd /d "%WORKSPACE_DIR%" node --version npm --version - npm ci + npm ci --loglevel warn if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% # -------------------------------------------------- # 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 if: success() shell: cmd 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%" npm run build if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% diff --git a/.gitea/workflows/deployTestCevital.yml b/.gitea/workflows/deployTestCevital.yml deleted file mode 100644 index 6d04e86..0000000 --- a/.gitea/workflows/deployTestCevital.yml +++ /dev/null @@ -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%