Deployment
Environments
Section titled “Environments”| Environment | URL | Branch | Deploys |
|---|---|---|---|
| Local | http://ENV_NAME.test | any | manual |
| Staging | https://staging.ENV_NAME.com | develop | on push |
| Production | https://ENV_NAME.com | main | manual trigger |
Deploying to staging
Section titled “Deploying to staging”Push to develop — GitHub Actions runs the deploy pipeline automatically:
- Composer install (no dev deps)
- JS/CSS build (
npm run build) - rsync to staging server over SSH
wp cache flushon the server
Deploying to production
Section titled “Deploying to production”Production deploys are manual to avoid accidents.
- Merge
develop→mainvia a PR - Go to GitHub Actions → Deploy to production → Run workflow
- Confirm the deploy completed in the Actions log
- Spot-check the live site
Database changes
Section titled “Database changes”Database changes are never automated. Before deploying any code that requires a schema change:
- Take a backup:
wp db export --add-drop-table pre-deploy.sql - Run the migration manually via WP-CLI or phpMyAdmin
- Then deploy the code
Rollback
Section titled “Rollback”# Revert the last deploy (re-deploys previous release)# SSH into the servercd /var/www/ENV_NAMEgit checkout <previous-commit>composer install --no-devwp cache flush