From 5860dd37cc03f7300e7bd882aa6c333d62652c50 Mon Sep 17 00:00:00 2001 From: libingxiang Date: Mon, 4 Aug 2025 16:36:15 +0800 Subject: [PATCH] ci --- .gitea/workflows/deploy.yaml | 43 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index c921c40..3f1f080 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -31,30 +31,33 @@ jobs: node --version npm --version -# # 检查并安装依赖(如果需要) -# - name: Install dependencies if needed -# run: | -# if [ ! -d "node_modules" ]; then -# echo "node_modules not found, installing dependencies..." -# npm install -# else -# echo "node_modules already exists, skipping installation" -# fi + # 检查并安装依赖(如果需要) + - name: Install dependencies if needed + run: | + if [ ! -d "node_modules" ]; then + echo "node_modules not found, installing dependencies..." + npm install + else + echo "node_modules already exists, skipping installation" + fi # 构建项目 - name: Build project run: | - npm run build + npm run build - # 直接移动 dist 目录到目标位置 + # 将 dist 目录移动到目标位置 - 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/" - sudo rm -rf /yantoo/frontend/* - sudo cp -r dist/* /yantoo/frontend/ - echo "Files successfully moved to /yantoo/frontend/" + 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 rm -rf /yantoo/frontend/study-online/* + + sudo cp -r dist/* /yantoo/frontend/study-online/ + + echo "Files successfully moved to /yantoo/frontend/study-online/"