This example triggers a GitHub Action workflow that creates a deploy when a deploy ended webhook is received for a specific service. While this specific example GitHub Action triggers another deploy, you may also want to:
- Run end-to-end tests
- Clear a CDN cache to serve the latest content
- Notify a monitoring system about new deployment details
- Sync data or run other post deployment migrations
If you haven't already, sign up for a Render account. Creating webhooks on Render requires a Professional plan or higher. You can view and upgrade your plan in the Render Dashboard.
- Use the button below to deploy to Render
- Follow the Render documentation to create a webhook with the URL from your service and
/webhook
path that is triggered upon only theDeployEnded
event. Save the signing secret as theRENDER_WEBHOOK_SECRET
environment variable. - Follow the Render documentation to create a Render API Key. Save the key as the
RENDER_API_KEY
environment variable. - Follow the GitHub documentation to create a GitHub Action secret named
RENDER_API_KEY
in your GitHub repo with the Render API key you created. - Follow the GitHub documentation to create a GitHub API token with read/write permissions for
Actions
. Save the token as theGITHUB_API_TOKEN
environment variable. - Create a GitHub workflow with a dispatch trigger as shown in the example. You can check out Git Hub Actions Documentation for more information.
- Set the following environment variables:
RENDER_WEBHOOK_SECRET
environment variable to the secret from the webhook created in step 2RENDER_API_KEY
to the key created in step 3GITHUB_API_TOKEN
to the token created in step 4GITHUB_OWNER_NAME
to the owner of the GitHub repo the workflow is in (ex.render-examples
)GITHUB_REPO_NAME
to the GitHub repo the workflow is in (ex.webhook-github-action
)GITHUB_WORKFLOW_ID
to the ID or filename of the workflow to trigger (ex.example.yaml
)
- Trigger a service deploy and watch the GitHub workflow get triggered.
Once you've created a project and installed dependencies with pnpm install
, start a development server:
pnpm run dev
pnpm run build