make
You can use./cli command
to run specified command.
Or you can use./cli
to get into the cli's shell and execute commands.
- n / new: create new webhook.
- d / delete id: delete specified webhook.
- m / modify id: modify existed webhook.
- e / execute id: execute specified webhook.
- l / list: list all webhooks.
- s / search keyword: search webhooks by a keyword in name or description.
- p / print id: print detail information of specified webhooks.
- h / help: print help information.
- q / quit: quit cli shell.
Start server by run./server
or./server port
,the default port is 8080.
Start server with pm2:pm2 start./server --name webhook-service -- 8080
.
- Firstly you should create a shell script that runs
git pull
and blog website update command. - Then you run the
cli
to create a new webhook, which executor is the path of the above script. - Copy the url from the output and register the webhook in your Github repo's webhook page.
- Then when you push a new commit to this repo, Github will send a post request to the server which will execute the specified script.