Spaces:
Running
Running
| # Build the project | |
| npm run build | |
| # Ensure the dist directory exists | |
| if [ -d "dist" ]; then | |
| # Copy all files from dist to the root, but not overwrite the src and public directories | |
| cp -r dist/* . | |
| # Optionally, clean up the dist directory after copying | |
| rm -rf dist | |
| else | |
| echo "Build directory 'dist' does not exist. Please run 'npm run build' first." | |
| exit 1 | |
| fi | |
| # Add, commit, and push changes to the repository | |
| git add . | |
| git commit -m "Deploy build" | |
| git push origin main --force | |