Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

murilo's avatar
Level 10

How deploy multiple hooks / one server

Hello , I have been deploy my laravel following that guide -

https://devmarketer.io/learn/deploy-laravel-5-app-lemp-stack-ubuntu-nginx/

There , shoes how deploy Laravel App for server with Hooks , Now , I have been working in a project that has a Laravel Application ( as back End ) and NODE + VUE ( as front end ) .

I need go to each application in my computer and push to production both , first I go in laravel application , after I go in node application , and both go to the same server but Different folders .

would be like that -

MY MACHINE -

	my_website_back_end ( Laravel )
        my_website_front_end ( Node )

On Server

var/www/my_website_back_end ( Laravel ) var/www/my_website_front_end ( Node )

I make the hook like this -

SETTING UP GIT HOOKS ON SERVER


cd /var
sudo mkdir repo && cd repo


sudo mkdir site.git && cd site.git
sudo git init --bare

cd hooks

sudo nano post-receive

ADD THOSE LINE ON HOOKS

#!/bin/sh
git --work-tree=/var/www/my_website_back_end  --git-dir=/var/repo/site.git checkout -f

MY APP ON MY COMPUTER

cd sites/my_website_back_end 

git remote add production ssh://root@PY_IP/var/repo/site.git

// here comes the magic , push to production
git push production master

how could I add , the other hook there ? the "front end hook ".

0 likes
0 replies

Please or to participate in this conversation.