This commit is contained in:
		
							parent
							
								
									694b6374e9
								
							
						
					
					
						commit
						c542d008e7
					
				| @ -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/" | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 libingxiang
						libingxiang