wget https://github.com/adnanh/webhook/releases/download/2.8.0/webhook-linux-amd64.tar.gz
tar -zxf webhook-linux-amd64.tar.gz
mv webhook-linux-amd64/webhook /usr/bin/webhook
chmod +x /usr/bin/webhook
Copy webhook.service to /usr/lib/systemd/system/webhook.service
Insert secret (see 'Create release hook') and copy hooks.json to /etc/webhook/hooks.json
Copy webhook to /etc/sysconfig/webhook
systemctl start webhook
tail -f /var/log/messages
server {
listen 80;
server_name deploy.example.com;
location /hooks/ {
# run webhook on port 9000
proxy_pass http://172.17.0.1:9000/hooks/;
}
}
Go to Repo - Settings - Hooks
- Payload URL: http://deploy.example.com/hooks/ (better with https)
- Content type: application/json
- Secret: Generate very strong password (ask google)
- Select event: Releases
Go to https://github.com/settings/tokens. Need access to repo.
copy redeploy-app.sh from Repo to ~/ on VPS
insert github token (see prev. paragraph)