I have my Laravel application deployed under /var/www/<host's name>/, whereas /var/www/<host's name>/public is the web-accessible directory. I'm using GitHub now for quite a while, however, I seem to have never made use of more of its potential (than just using it as a code backup source). What I want to achieve:
- I'm working on my application on localhost
- I'm pusing to my Git's master
- Somewhere in my server (perhaps outside the /var/www/ directory), I want to clone my Git and have everything pulled from GitHub, so that the web application is 'updated' so to speak
However, I don't want existing data (such as <laravel>/storage/app/users/, which contains folders of all users and their files) to be deleted or something. I just want the most current version of my code running, patching while running so to speak. I know git clone <url>, and I know symlinks.
I just thought of a folder, perhaps in my home folder, named after my application's name (e.g. "/home/myuser/laravel") and now running git clone ... shall automatically do what I described, so that accessing the webpage returns with the code we updated just before.
I hope I decently crossed my point, am looking forward to seeing suggestions on this.