Skip to content

jmikedupont2/on-demand-isr

 
 

Repository files navigation

See project https://github.com/jmikedupont2/on-demand-incremental-static-regeneration for my changes, this repo is for reporting issues upstream.

Deploy with Vercel

On-Demand Incremental Static Regeneration

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.

Setup

For vercel deployment, add the environmental variables to your server secret settings, https://vercel.com/<username>/<project>/settings/environment-variables, For local deploy add the variables to .env.local, do not check them in.

  1. Create a new GitHub App
    1. Provide the URL of your deployed application for Homepage URL
    2. Ensure Webhook "Active" is checked
    3. Add <your-site>/api/webhook as the Webhook URL
    4. Create a Webhook secret and add it to .env.local as GITHUB_WEBHOOK_SECRET
    5. Give "Read Only" access to Issues
    6. Subscribe to "Issues" events
  2. Add the App ID to .env.local as GITHUB_APP_ID
  3. Generate a private key and add it to .env.local as GITHUB_APP_PK_PEM quote and replace newlines like this : GITHUB_APP_PK_PEM="-----BEGIN RSA PRIVATE KEY-----\nABCEF==\n-----END RSA PRIVATE KEY-----"
  4. Install the newly created GitHub App for your repo
  5. https://github.com/settings/apps/<your-app-name>/installations

Running Locally

$ bun dev

Learn More

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 72.1%
  • SCSS 16.7%
  • CSS 9.6%
  • JavaScript 1.6%