ci
Some checks failed
study-online / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
libingxiang 2025-08-04 16:29:35 +08:00
parent 8121b07b1c
commit 2567534a9d

View File

@ -26,31 +26,35 @@ jobs:
# 使用系统已安装的 Node.js v16.15.0 # 使用系统已安装的 Node.js v16.15.0
- name: Use system Node.js v16.15.0 - name: Use system Node.js v16.15.0
run: | run: |
echo "Using system Node.js" echo "Using system Node.js"
node --version node --version
npm --version npm --version
# 确保 Node.js 在 PATH 中
export PATH=$(dirname $(which node)):$PATH
- name: Install dependencies # 检查并安装依赖(如果需要)
run: npm install - name: Install dependencies if needed
run: |
- name: Build project if [ ! -d "node_modules" ]; then
run: npm run build echo "node_modules not found, installing dependencies..."
npm install
- name: Package dist folder else
run: | echo "node_modules already exists, skipping installation"
if [ ! -d "dist" ]; then
echo "Error: dist directory not found"
ls -la
exit 1
fi fi
zip -r frontend-dist.zip dist
sudo mv frontend-dist.zip /yantoo/frontend/
- name: Extract package in target directory # 构建项目
run: | - name: Build project
cd /yantoo/frontend/ run: |
sudo unzip -o frontend-dist.zip npm run build
sudo rm frontend-dist.zip
# 直接移动 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/"