This commit is contained in:
parent
2827c1f160
commit
5860dd37cc
@ -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/"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user