Create a webhook in the panel (http://<panel-ip>/hook?access_key=<your-key>¶m=front)
Place it in https://github.com/<user>/<project>/settings/hooks with the events you need
Edit the script to be
if [ $1 = "front" ]; then
cd /www/wwwroot/<frontend-website>/
git pull -v &>> pull.log
npm run build &>> build.log
echo "Successfully pulled frontend"
elif [ $1 = "back" ]; then
cd /www/wwwroot/<backend-website>/
git pull -v &>> pull.log
php artisan migrate &>> migrate.log
echo "Successfully pulled backend"
fi
And here, only the front project will be pulled because of the URL parameter
Hope it helps