- Generate ssh keys for
www-data
:
sudo mkdir /var/www/.ssh
sudo chown -R www-data /var/www/.ssh
sudo -u www-data ssh-keygen -t rsa
- Add that ssh key to the
Deploy keys
for your account or repo - Put this WebhookController into your app and fill the secret with random data
- Create Webhook, put secret from controller into the
Secret
field.URL
has to be like this:
site.com/webhook
- Add access to your repo for
www-data
user:
chown -R www-data /var/www/yourrepo/
All done!