Gitlab Publish

Gitlab Publish

By Striffly

Trigger GitLab pipeline in one click !

Latest version

v0.0.3

released January 8, 2025

npm install strapi-plugin-gitlab-publish

Strapi plugin gitlab-publish

NPM version PR Welcome

This is a plugin for Strapi headless CMS. It lets you trigger a GitLab Action workflow when the site is ready to be published.

Inspired by strapi-plugin-github-publish project, thanks to Phantom for his work !

Introduction

Screenshot

When using Strapi as a headless CMS for a statically built website you need a way to trigger the site to rebuild when content has been updated. The typical approach is to setup a Strapi managed webhook to trigger a CI/CD pipeline whenever content changes. This approach has it's issues. For example when making many changes to content, builds are triggered multiple times and deployments can fail due to the site being deployed concurrently.

This plugin tackles the publishing flow a different way. The site administrators can take their time and make many changes and once the content update is complete they can trigger a single build.

Installation

Install this plugin with npm / yarn / pnpm.

With npm:

npm install strapi-plugin-github-publish

With yarn:

yarn add strapi-plugin-github-publish

With pnpm:

pnpm add strapi-plugin-github-publish

Configuration

Generate a config file at config/plugins.js or config/development/plugins.js etc...

module.exports = ({ env }) => ({
  "github-publish": {
    enabled: true,
    config: {
      project_id: env("GITLAB_PROJECT_ID"),
      project_branch: env("GITLAB_PROJECT_BRANCH"),
      project_pipeline_token: env("GITLAB_PROJECT_PIPELINE_TOKEN"),
    },
  },
});

Make sure you have variable in your .env file

GITLAB_PROJECT_ID=tobemodified
GITLAB_PROJECT_BRANCH=tobemodified
GITLAB_PROJECT_PIPELINE_TOKEN=tobemodified

Use the Plugin

When the plugin has been installed correctly just click on GitLab Publish in the sidebar under plugins then click "Publish".

Submit your content

Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.

Submit
Submit your content