The deployment scripts were not properly cleaning up old build files before deploying new ones, causing:
- Accumulation of old JS and CSS files in the assets directory
- Potential confusion about which files were actually being served
- Wasted disk space
Both deploy.sh and build-and-deploy.sh have been updated to:
- Clear old deployed assets - Delete only
.jsand.cssfiles from assets directory before building - Clear build cache - Remove
dist/andnode_modules/.vitefor clean builds - Build fresh - Run
npm run buildto generate new files - Auto-deploy - Automatically copy built files to the deployment location
- Set permissions - Ensure proper file ownership and permissions
- Old build files accumulated (19+ old JS/CSS files)
- Manual deployment step required after build
- Risk of serving stale files
- Only current build files (3 files: 1 JS, 1 CSS, 1 generated CSS)
- Automatic deployment after successful build
- Clean deployment directory every time
./deploy.shThis will:
- Clean old files
- Build new files
- Deploy automatically
- Set permissions
./build-and-deploy.shThis will:
- Clean old files
- Build new files
- Deploy automatically
- Commit changes to git
- Push to remote repository
After deployment, you can verify:
# Check deployed files
ls -la assets/
# Check site is live
curl -I https://yeladim.churchYou should see only 3 files in the assets directory after deployment.
- The source
index.htmlis now properly preserved during deployment - Old build artifacts are cleaned before each build
- Deployment happens automatically after successful build
- The site goes live immediately after deployment completes