Strapi plugin to trigger and monitor external rebuild pipelines across GitLab and GitHub.
released May 16, 2026
npm install @francescoliverio/strapi-plugin-rebuilder
Rebuild your Next.js SSR / SSG / ISR site from the Strapi admin panel โ one click, live status, full history. Works with GitLab CI and GitHub Actions.

A Strapi plugin that adds a Rebuild button inside the admin panel so editors can rebuild and redeploy a Next.js site without leaving Strapi.
It's the missing link between Strapi as a headless CMS and a Next.js SSR / SSG / ISR front-end: editors update content, click Rebuild, and the static site or server-rendered app gets regenerated with the latest data. Works with both GitLab pipelines and GitHub Actions workflows behind the same UI.
TRIGGERED_BYworkflow_dispatch)workflow_dispatch.The plugin is published on npmjs.com โ no auth, no private registry, just:
npm install @francescoliverio/strapi-plugin-rebuilder
# or
yarn add @francescoliverio/strapi-plugin-rebuilder
# or
pnpm add @francescoliverio/strapi-plugin-rebuilder
# or
bun add @francescoliverio/strapi-plugin-rebuilderIf you plan to use the GitHub Actions provider, enable raw body access in config/middlewares.ts (required for webhook signature verification):
{
name: "strapi::body",
config: { includeUnparsed: true },
}Strapi v4 and v5 are both supported (see the compatibility badges above).
Pick a provider via NEXJS_REBUILDER_PROVIDER (gitlab or github, default gitlab). Ready-to-copy .env templates live in examples/.
examples/.env.gitlab.example| Variable | Required | Description |
|---|---|---|
NEXJS_REBUILDER_GITLAB_PROJECT_ID | โ | GitLab project ID |
NEXJS_REBUILDER_GITLAB_TRIGGER_TOKEN | โ | Pipeline trigger token |
NEXJS_REBUILDER_GITLAB_WEBHOOK_SECRET | โ | Validated against X-Gitlab-Token |
NEXJS_REBUILDER_GITLAB_REF | โ | Branch/ref. Default: main |
NEXJS_REBUILDER_GITLAB_API_BASE_URL | โ | For self-managed GitLab |
examples/.env.github.example| Variable | Required | Description |
|---|---|---|
NEXJS_REBUILDER_GITHUB_OWNER | โ | Repository owner |
NEXJS_REBUILDER_GITHUB_REPO | โ | Repository name |
NEXJS_REBUILDER_GITHUB_WORKFLOW_ID | โ | Workflow filename (e.g. deploy.yml) |
NEXJS_REBUILDER_GITHUB_TOKEN | โ | Token with Actions write |
NEXJS_REBUILDER_GITHUB_WEBHOOK_SECRET | โ | Verified via X-Hub-Signature-256 |
NEXJS_REBUILDER_GITHUB_REF | โ | Branch/tag. Default: main |
The plugin triggers pipelines through GitLab/GitHub APIs, but it needs a webhook back to know when those pipelines start, succeed or fail. Without the webhook, the Rebuilder UI would never update after you click Rebuild.
You configure this once, on the side of GitLab or GitHub, pointing to your Strapi instance.
The webhook URL is always:
https://your-strapi-domain.com/api/nexjs-rebuilder/webhookReplace your-strapi-domain.com with the public URL of your Strapi server. The endpoint is intentionally public (GitLab/GitHub need to reach it), but every request is verified against the secret you set in your .env โ so only your CI provider can post to it.
NEXJS_REBUILDER_GITLAB_WEBHOOK_SECRET. GitLab sends it as the X-Gitlab-Token header and the plugin validates it on every call.Docs: GitLab webhooks
application/json.NEXJS_REBUILDER_GITHUB_WEBHOOK_SECRET. GitHub signs every request with it via X-Hub-Signature-256 and the plugin verifies the signature.Important: GitHub signature verification needs Strapi's body middleware to expose the raw request body. Make sure config/middlewares.ts has includeUnparsed: true (see the Install section).
Docs: GitHub webhooks ยท validating deliveries
Two ready-to-use CI files live in examples/ โ copy them into your Next.js (or any) repo and tweak the deploy steps.
examples/gitlab-ci.ymlDrop it at the root of your repo as .gitlab-ci.yml. The plugin sends two variables you can use:
BUILD_MESSAGE โ the label the editor typed in StrapiTRIGGERED_BY โ the Strapi admin who clicked RebuildSnippet โ naming the pipeline after the editor's message:
workflow:
name: "$PIPELINE_NAME"
rules:
- if: '$CI_PIPELINE_SOURCE == "trigger" && $BUILD_MESSAGE'
variables:
PIPELINE_NAME: "$BUILD_MESSAGE"
- when: always
variables:
PIPELINE_NAME: "$CI_COMMIT_TITLE"GitLab docs: pipeline triggers ยท trigger token API ยท webhook events
examples/github-actions-deploy.ymlDrop it in your repo at .github/workflows/deploy.yml, then point Strapi at it:
NEXJS_REBUILDER_PROVIDER=github
NEXJS_REBUILDER_GITHUB_WORKFLOW_ID=deploy.ymlThe plugin dispatches the workflow with two inputs. Your workflow must declare them or GitHub will reject the dispatch:
name: Deploy
run-name: ${{ inputs.build_message || github.event.head_commit.message || github.workflow }}
on:
workflow_dispatch:
inputs:
build_message:
type: string
triggered_by:
type: stringGitHub docs: workflow_dispatch ยท REST API ยท validating webhooks
build_message/triggered_by inputs.includeUnparsed: true is set in config/middlewares.ts.CI_PIPELINE_SOURCE == "trigger".Thanks to everyone who has helped shape this plugin.
This plugin is released under the MIT License โ free to use, modify and distribute, including for commercial use. The only requirement is to keep the copyright notice intact.
Copyright (c) 2026 Francesco OliverioSee the full license text in LICENSE.
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
