diff --git a/doc/images/input_url.png b/doc/images/input_url.png new file mode 100644 index 00000000..8cc9ce9f Binary files /dev/null and b/doc/images/input_url.png differ diff --git a/doc/images/jobs.png b/doc/images/jobs.png new file mode 100644 index 00000000..8e808259 Binary files /dev/null and b/doc/images/jobs.png differ diff --git a/doc/images/select_events.png b/doc/images/select_events.png new file mode 100644 index 00000000..0ec5c7e0 Binary files /dev/null and b/doc/images/select_events.png differ diff --git a/doc/images/tls_config.png b/doc/images/tls_config.png new file mode 100644 index 00000000..b06fb18a Binary files /dev/null and b/doc/images/tls_config.png differ diff --git a/doc/images/webhooks.png b/doc/images/webhooks.png new file mode 100644 index 00000000..91210fae Binary files /dev/null and b/doc/images/webhooks.png differ diff --git a/doc/webhooks.md b/doc/webhooks.md index 03dd8956..04898773 100644 --- a/doc/webhooks.md +++ b/doc/webhooks.md @@ -2,7 +2,13 @@ Garm is designed to auto-scale github runners. To achieve this, ```garm``` relies on [GitHub Webhooks](https://docs.github.com/en/developers/webhooks-and-events/webhooks/about-webhooks). Webhooks allow ```garm``` to react to workflow events from your repository, organization or enterprise. -In your repository or organization, navigate to ```Settings --> Webhooks```. In the ```Payload URL``` field, enter the URL to the ```garm``` webhook endpoint. The ```garm``` API endpoint for webhooks is: +In your repository or organization, navigate to ```Settings --> Webhooks```: + +![webhooks](images/webhooks.png) + +And click on ```Add webhook```. + +In the ```Payload URL``` field, enter the URL to the ```garm``` webhook endpoint. The ```garm``` API endpoint for webhooks is: ```txt POST /webhooks @@ -24,4 +30,27 @@ The webhook secret must be secure. Use something like this to generate one: 9Q*nsr*S54g0imK64(!2$Ns6C!~VsH(p)cFj+AMLug%LM!R%FOQ ``` -Next, you can choose which events GitHub should send to ```garm``` via webhooks. Click on ```Let me select individual events``` and select ```Workflow jobs``` (should be at the bottom). You can send everything if you want, but any events ```garm``` doesn't care about will simply be ignored. +Make a note of that secret, as you'll need it later when you define the repo/org/enterprise in ```GARM```. + +![webhook](images/input_url.png) + +While you can use `http` for your webhook, I highly recommend you set up a proper x509 certificate for your GARM server and use `https` instead. If you choose `https`, GitHub will present you with an aditional option to configure the SSL certificate verification. + +![ssl](images/tls_config.png) + +If you're testing, you can disable SSL verification or just use `http`, but for production you should use `https` with a proper certificate and SSL verification set to `enabled`. + +It's fairly trivial to set up a proper x509 certificate for your GARM server. You can use [Let's Encrypt](https://letsencrypt.org/) to get a free certificate. + + +Next, you can choose which events GitHub should send to ```garm``` via webhooks. Click on ```Let me select individual events```. + +![events](images/select_events.png) + +Now select ```Workflow jobs``` (should be at the bottom). You can send everything if you want, but any events ```garm``` doesn't care about will simply be ignored. + +![workflow](images/jobs.png) + +Finally, click on ```Add webhook``` and you're done. + +GitHub will send a test webhook to your endpoint. If all is well, you should see a green checkmark next to your webhook. \ No newline at end of file