Getting code onto the server reliably.
THE APPROACHES
Manual upload by SFTP. Simple, error-prone, and hard to reverse. Git pull on the server. The repository is the source of truth and rolling back is straightforward. A deployment tool that automates the sequence. A pipeline triggered by a commit.
A REASONABLE PROGRESSION
Start with git pull on the server. It gives version history and easy rollback without much setup.
Add automation when manual deployment becomes the bottleneck.
WHAT A DEPLOYMENT USUALLY INVOLVES
Fetch the new code Install dependencies Run database migrations Clear caches Restart or reload services Verify
DO NOT DEPLOY BY EDITING FILES ON THE SERVER
Changes made directly on the server are lost at the next deployment and exist nowhere else. It is the most common cause of mysterious regressions.
CONFIGURATION
Keep environment-specific configuration out of the repository, in a file or environment variables on the server.
ROLLBACK
Know how to reverse a deployment before you need to.