Demo of On-demand ISR in Next.js using GitHub Issues. When a new issue is created, a webhook from a GitHub App pushes new changes to the deployed application to regenerate the static page.
- Create a new GitHub App
- Provide the URL of your deployed application for Homepage URL
- Ensure Webhook "Active" is checked
- Add
<your-site>/api/webhook
as the Webhook URL - Create a Webhook secret and add it to
.env.local
asGITHUB_WEBHOOK_SECRET
- Give "Read Only" access to Issues
- Subscribe to "Issues" events
- Add the App ID to
.env.local
asGITHUB_APP_ID
- Generate a private key and add it to
.env.local
asGITHUB_APP_PK_PEM
- Install the newly created GitHub App for your repo
https://github.com/settings/apps/<your-app-name>/installations
$ bun dev