From c542d008e7ca55d3bd11f32c7074b119fe5f5273 Mon Sep 17 00:00:00 2001 From: libingxiang Date: Mon, 4 Aug 2025 17:15:01 +0800 Subject: [PATCH] ci --- .gitea/workflows/deploy.yaml | 41 ++++++++++-------------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 2c2c6f1..442001d 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -32,36 +32,17 @@ jobs: unset CI nvm use 23.5.0 - # 安装依赖 - - name: Install dependencies + - name: Compile code and build run: | - echo "Installing dependencies..." - # 使用 --legacy-peer-deps 避免依赖冲突 - npm install --legacy-peer-deps - - # 构建项目 - - name: Build project - run: | - echo "Building project..." - # 设置环境变量 - export NODE_OPTIONS="--no-warnings" - export VITE_CJS_IGNORE_WARNING=true - - # 执行构建 - npm run build - - # 移动构建产物 - - name: Move dist folder to target directory - run: | - if [ ! -d "dist" ]; then - echo "Error: dist directory not found" - ls -la - exit 1 - fi - echo "Dist directory found, moving to /yantoo/frontend/study-online/" - - sudo mkdir -p /yantoo/frontend/study-online - sudo rm -rf /yantoo/frontend/study-online/* - sudo cp -r dist/* /yantoo/frontend/study-online/ + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + unset CI + nvm use 22.14.0 + yarn + yarn build + cd dist/ + zip -r study-online.zip . + mv study-online.zip /yantoo/pkg/ + sh /yantoo/bin/front.sh echo "Files successfully moved to /yantoo/frontend/study-online/"