Skip to content

YasiOnFire/gridsome-webhook-builder

Repository files navigation

Gridsome Webhook Builder 👷🏻

Why?:

If you are using a static site generator like Gridsome (Or Gatsby) with a backend CMS like WordPress, you will need a way to trigger the fetch&&rebuild of new content after update. Using JAMstack Deployments plugin for wordpress and this script you will be able to trigger the rebuild after any update or manually for that matter.

Features:

  • runs build in child process
  • rate limiter
  • build limiter
  • logging to file
  • logging to Sentry.io
  • logrotate

Usage:

Clone somwhere close to your Gridsome project (ideally next to the project files [not inside!]).

Rename sample.env to .env

Change TARGET_DIR to relative directory to your gridsome project (or leave as is)

Install deps:

yarn

Start local:

yarn run start:dev

Build & Start prod

Change NODE_ENV to production in .env and run:

yarn run build
yarn run start:prod # or pm2 start dist/main.js --time --watch

Using Sentry

Just add your project dsn to .env

Local test

You can test the webhook trigger and build using localtunnel like ngork or localtunnel (with lt -h "https://serverless.social" -p 3333 command)

You can change the build command in app.service to run any desired build command.

About

Node webhook service to trigger Gridsome Build

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published