You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Example to Trigger GitHub Actions from a Render Webhook
2
2
3
-
This basic example receives webhooks and logs the payload.
4
-
It will fetch service, Postgres, or Key Value store information from the RENDER API for certain webhook types.
3
+
This example triggers a GitHub Action workflow when a deploy ended webhook is received for a specific service.
5
4
6
5
## Deploy to Render
7
6
@@ -10,5 +9,13 @@ It will fetch service, Postgres, or Key Value store information from the RENDER
10
9
11
10
2. Follow [instructions](https://render.com/docs/webhooks) to create a webhook with the URL from your service and `/webhook` path
12
11
3. Follow [instructions](https://render.com/docs/api#1-create-an-api-key) to create a Render API Key
13
-
4. Set `RENDER_WEBHOOK_SECRET` environment variable to the secret from the webhook created in step 2. SET `RENDER_API_KEY` to the key created in step 3.
14
-
5. Trigger a service deploy and watch the webhooks roll in.
12
+
4. Follow [instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) to create a GitHub api token with read/write permissions for `Actions`
13
+
5. Create a github workflow with a dispatch trigger as shown in the [example](./.github/workflows/example.yaml)
14
+
6. Set the following env vars
15
+
-`RENDER_WEBHOOK_SECRET` environment variable to the secret from the webhook created in step 2
16
+
-`RENDER_API_KEY` to the key created in step 3
17
+
-`GITHUB_API_TOKEN` to the token created in step 4
18
+
-`GITHUB_OWNER_NAME` to the owner of the GitHub repo the workflow is in (ex. `render-examples`)
19
+
-`GITHUB_REPO_NAME` to the GitHub repo the workflow is in (ex. `webhook-github-action`)
20
+
-`GITHUB_WORKFLOW_ID` to the ID or filename of the workflow to trigger (ex. `example.yaml`)
21
+
7. Trigger a service deploy and watch the GitHub workflow get triggered.
0 commit comments