cicd work

This commit is contained in:
Abderrahmane 2026-04-28 10:26:40 +01:00
parent 7632672d65
commit dc2260cab2
2 changed files with 66 additions and 1 deletions

View File

@ -0,0 +1,64 @@
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/TrizTresorieRepository.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%

3
.gitignore vendored
View File

@ -19,4 +19,5 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
/external
/external
/.idea