This commit is contained in:
parent
2827c1f160
commit
5860dd37cc
@ -31,30 +31,33 @@ jobs:
|
|||||||
node --version
|
node --version
|
||||||
npm --version
|
npm --version
|
||||||
|
|
||||||
# # 检查并安装依赖(如果需要)
|
# 检查并安装依赖(如果需要)
|
||||||
# - name: Install dependencies if needed
|
- name: Install dependencies if needed
|
||||||
# run: |
|
run: |
|
||||||
# if [ ! -d "node_modules" ]; then
|
if [ ! -d "node_modules" ]; then
|
||||||
# echo "node_modules not found, installing dependencies..."
|
echo "node_modules not found, installing dependencies..."
|
||||||
# npm install
|
npm install
|
||||||
# else
|
else
|
||||||
# echo "node_modules already exists, skipping installation"
|
echo "node_modules already exists, skipping installation"
|
||||||
# fi
|
fi
|
||||||
|
|
||||||
# 构建项目
|
# 构建项目
|
||||||
- name: Build project
|
- name: Build project
|
||||||
run: |
|
run: |
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
# 直接移动 dist 目录到目标位置
|
# 将 dist 目录移动到目标位置
|
||||||
- name: Move dist folder to target directory
|
- name: Move dist folder to target directory
|
||||||
run: |
|
run: |
|
||||||
if [ ! -d "dist" ]; then
|
if [ ! -d "dist" ]; then
|
||||||
echo "Error: dist directory not found"
|
echo "Error: dist directory not found"
|
||||||
ls -la
|
ls -la
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Dist directory found, moving to /yantoo/frontend/"
|
echo "Dist directory found, moving to /yantoo/frontend/study-online/"
|
||||||
sudo rm -rf /yantoo/frontend/*
|
|
||||||
sudo cp -r dist/* /yantoo/frontend/
|
sudo rm -rf /yantoo/frontend/study-online/*
|
||||||
echo "Files successfully moved to /yantoo/frontend/"
|
|
||||||
|
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