Publish/Deploy site - best practices?

Posted 7 months ago by Axeia


I've developed a site using Laravel and I'm finally ready to deploy it to the live (shared) server. I've currently just uploaded everything through sftp (with WinSCP), exported/imported the database. Put laravels /public / folder in the servers public_html/ folder and fixed anything that broke due to environment changes (different MySQL versions). So basically I did what this video by Traversy Media also tells you to do:

However uploading a new version is a bit of a nightmare, simply dragging the folders over in WinSCP and applying what database changes are needed takes a long time, surely there must be a faster way to do this? Just the file uploading can take 20 minutes. Zipping things up and then unzipping it through the cpanel takes less time to upload but adds additional steps slowing things down.

Tools at my disposal: A linux (openSUSE) local server that stores the files and acts as the local webserver that I have full access to, my own Windows 10 desktop. And I can connect to the remote shared host/server through WinSCP (FTP/SFTP), putty, cpanel.

[edit] Ideallly I'd just run a script that uploads only files that have changed, doesn't overwrite the .htaccess that's different between the local and remote server, minifies the CSS/javascript etc. Seen some guides recommending to use git to speed things up. I'd like some advice/examples of what other people are doing and what the best approach is. Thank you :).

Please sign in or create an account to participate in this conversation.