Skip to content

Commit 3761be4

Browse files
committed
📝 Update README
1 parent 84273d2 commit 3761be4

File tree

2 files changed

+73
-2
lines changed

2 files changed

+73
-2
lines changed

README.md

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,74 @@
1-
# gitlab-publish
1+
# Strapi plugin gitlab-publish
22

3-
Trigger GitLab pipeline in one click !
3+
[![NPM version][npm-image]][npm-url]
4+
[![PR Welcome][npm-downloads-image]][npm-downloads-url]
5+
6+
This is a plugin for [Strapi](https://github.com/strapi/strapi) headless CMS. It lets you trigger a GitLab Action workflow when the site is ready to be published.
7+
8+
Inspired by [strapi-plugin-github-publish](https://github.com/phantomstudios/strapi-plugin-github-publish) project, thanks to [Phantom](https://github.com/phantomstudios) for his work !<br>
9+
10+
## Introduction
11+
12+
![Screenshot](./docs/screenshot.png "Plugin Screenshot")
13+
14+
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.
15+
16+
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.
17+
18+
## Installation
19+
20+
Install this plugin with npm / yarn / pnpm.
21+
22+
With npm:
23+
24+
```bash
25+
npm install strapi-plugin-github-publish
26+
```
27+
28+
With yarn:
29+
30+
```bash
31+
yarn add strapi-plugin-github-publish
32+
```
33+
34+
With pnpm:
35+
36+
```bash
37+
pnpm add strapi-plugin-github-publish
38+
```
39+
40+
## Configuration
41+
42+
Generate a config file at `config/plugins.js` or `config/development/plugins.js` etc...
43+
44+
```javascript
45+
module.exports = ({ env }) => ({
46+
"github-publish": {
47+
enabled: true,
48+
config: {
49+
project_id: env("GITLAB_PROJECT_ID"),
50+
project_branch: env("GITLAB_PROJECT_BRANCH"),
51+
project_pipeline_token: env("GITLAB_PROJECT_PIPELINE_TOKEN"),
52+
},
53+
},
54+
});
55+
```
56+
57+
Make sure you have variable in your .env file
58+
59+
```bash
60+
GITLAB_PROJECT_ID=tobemodified
61+
GITLAB_PROJECT_BRANCH=tobemodified
62+
GITLAB_PROJECT_PIPELINE_TOKEN=tobemodified
63+
```
64+
65+
## Use the Plugin
66+
67+
When the plugin has been installed correctly just click on `GitLab Publish` in the sidebar under plugins then click "Publish".
68+
69+
[npm-image]: https://img.shields.io/npm/v/strapi-plugin-gitlab-publish.svg?style=flat-square&logo=react
70+
[npm-url]: https://npmjs.org/package/strapi-plugin-gitlab-publish
71+
[npm-downloads-image]: https://img.shields.io/npm/dm/strapi-plugin-gitlab-publish.svg
72+
[npm-downloads-url]: https://npmcharts.com/compare/strapi-plugin-gitlab-publish?minimal=true
73+
[ci-image]: https://github.com/Striffly/strapi-plugin-gitlab-publish/workflows/Test/badge.svg
74+
[ci-url]: https://github.com/Striffly/strapi-plugin-gitlab-publish/actions

docs/screenshot.png

9.28 KB
Loading

0 commit comments

Comments
 (0)