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 example triggers a GitHub Action workflow when a deploy ended webhook is received for a specific service.
3
+
This example triggers a GitHub Action workflow that creates a deploy when a deploy ended webhook is received for a specific service.
4
4
5
5
## Deploy to Render
6
6
7
7
1. Use the button below to deploy to Render </br>
8
8
<ahref="https://render.com/deploy?repo=https://github.com/render-examples/webhook-github-action/tree/main"><imgsrc="https://render.com/images/deploy-to-render-button.svg"alt="Deploy to Render"></a>
9
9
10
-
2. Follow [instructions](https://render.com/docs/webhooks) to create a webhook with the URL from your service and `/webhook` path
11
-
3. Follow [instructions](https://render.com/docs/api#1-create-an-api-key) to create a Render API Key
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
10
+
2. Set the following environment variables:
18
11
-`GITHUB_OWNER_NAME` to the owner of the GitHub repo the workflow is in (ex. `render-examples`)
19
12
-`GITHUB_REPO_NAME` to the GitHub repo the workflow is in (ex. `webhook-github-action`)
20
13
-`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.
14
+
15
+
3. Follow the [Render documentation](https://render.com/docs/webhooks) to create a webhook with the URL from your service and `/webhook` path that is triggered upon only the `DeployEnded` event. Save the signing secret as the `RENDER_WEBHOOK_SECRET` environment variable.
16
+
4. Follow the [Render documentation](https://render.com/docs/api#1-create-an-api-key) to create a Render API Key. Save the key as the `RENDER_API_KEY` environment variable.
17
+
5. Follow [the GitHub documentation](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) to create a GitHub Action secret named `RENDER_API_KEY` in your GitHub repo with the Render API key you created.
18
+
6. Follow [the GitHub documentation](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`. Save the token as the `GITHUB_API_TOKEN` environment variable.
19
+
7. Create a GitHub workflow with a dispatch trigger as shown in the [example](./.github/workflows/example.yaml)
20
+
8. Trigger a service deploy and watch the GitHub workflow get triggered.
0 commit comments