1
0
Fork 0
No description
Find a file
2024-12-14 22:55:16 +01:00
etc add files 2024-12-14 22:55:16 +01:00
usr/local/bin add files 2024-12-14 22:55:16 +01:00
LICENSE Initial commit 2024-12-14 21:21:15 +00:00
README.md add files 2024-12-14 22:55:16 +01:00

webhookd-update

Use webhookd behind basic auth to listen for github push events and run a script to fetch latest commit and do something afterwards.

First:

  1. pick a basic auth password and write it down
  2. pick a github push secret and write it down

On the server:

  1. clone github repo into /root/site
  2. install ncarlier/webhookd to /usr/local/bin/webhookd
  3. copy files from this repo's etc and usr directory to /etc resp. /usr
  4. run htpasswd /etc/webhookd/htpasswd gitpush with secret from step 1
  5. in /etc/systemd/system/webhookd.service, set Environment=GITHUB_SECRET=xxx to secret from step 2
  6. add custom scripting in /usr/local/bin/update-site
  7. run systemctl daemon-reload
  8. run systemctl enable webhookd
  9. run systemctl start webhookd

Setup webhook in GitHub:

  1. url: http://gitpush:<basicauthpassword><server-addr>:9999/github
  2. secret: secret from step 2
  3. trigger: just the push event