Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions deploy/gitlab.mdx
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
---
title: "GitLab"
description: "Connect to a GitLab repository for automated deployments and preview builds."
keywords: ["GitLab integration", "access tokens", "merge request previews"]
keywords: ["GitLab integration", "access tokens", "merge request previews", "self-hosted", "instance"]
---

We use access tokens and webhooks to authenticate and sync changes between GitLab and Mintlify.
Mintlify uses access tokens and webhooks to authenticate and sync changes between GitLab and Mintlify.

- Mintlify uses access tokens to pull information from GitLab.
- GitLab uses webhooks to notify Mintlify when changes are made, enabling preview deployments for merge requests.
- GitLab uses webhooks to notify Mintlify when you make changes, which enables preview deployments for merge requests.

## Set up the connection

<Note>
**HTTPS cloning required**: Your GitLab project must have HTTPS cloning enabled for Mintlify to access your repository. You can verify this in GitLab by going to your project's **Settings** > **General** > **Visibility and access controls** section.
</Note>

<Steps>
<Step title="Find your project ID">
In your GitLab project, navigate to **Settings** > **General** and locate your **Project ID**.
Expand Down Expand Up @@ -44,8 +40,10 @@
<Step title="Set up the connection">
In the [Mintlify dashboard](https://dashboard.mintlify.com/settings/deployment/git-settings):
1. Enter your project ID and access token.
2. Complete any other required configurations.
3. Click **Save Changes**.
2. If you have a monorepo and your documentation is not at the root of your repository, enable the **Set up as monorepo** toggle and enter the relative path to your docs directory.
3. If you use a self-hosted GitLab instance, enable the **Set up as self-hosted** toggle and enter your GitLab instance's host URL (for example, `https://gitlab.your-domain.com`). Your instance must be publicly accessible for Mintlify to reach it.
4. Select the branch to deploy your documentation from.
5. Click **Save Changes**.
<Frame>
<img src="/images/gitlab/gitlab-config-light.png" alt="The GitLab configuration panel in the Git Settings page of the Mintlify dashboard." className="block dark:hidden" />
<img src="/images/gitlab/gitlab-config-dark.png" alt="The GitLab configuration panel in the Git Settings page of the Mintlify dashboard." className="hidden dark:block" />
Expand All @@ -55,7 +53,7 @@

## Create the webhook

Webhooks allow us to receive events when changes are made so that we can

Check warning on line 56 in deploy/gitlab.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/gitlab.mdx#L56

In general, use active voice instead of passive voice ('are made').
automatically trigger deployments.

<Steps>
Expand All @@ -71,8 +69,8 @@

In the **URL** field, enter the endpoint `https://leaves.mintlify.com/gitlab-webhook`.
</Step>
<Step title="Get webtoken">

Check warning on line 72 in deploy/gitlab.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/gitlab.mdx#L72

Did you really mean 'webtoken'?
In your Mintlify dashboard, click **Show Webtoken**. Copy the webtoken.

Check warning on line 73 in deploy/gitlab.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/gitlab.mdx#L73

Did you really mean 'Webtoken'?

Check warning on line 73 in deploy/gitlab.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/gitlab.mdx#L73

Did you really mean 'webtoken'?
<Frame>
<img src="/images/gitlab/show-webtoken-light.png" alt="Screenshot of the GitLab connection in the Mintlify dashboard." className="block dark:hidden" />
<img src="/images/gitlab/show-webtoken-dark.png" alt="Screenshot of the GitLab connection in the Mintlify dashboard." className="hidden dark:block" />
Expand Down Expand Up @@ -101,7 +99,7 @@
</Frame>
</Step>
<Step title="Test the webhook">
After you create the webhook, click the **Test** dropdown. Click **Push events** to send a sample payload. If the test returns `Hook executed successfully: HTTP 200`, your webhook is configured correctly.

Check warning on line 102 in deploy/gitlab.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/gitlab.mdx#L102

In general, use active voice instead of passive voice ('is configured').

<Frame>
<img src="/images/gitlab/gitlab-project-webtoken-test.png" alt="Screenshot of the GitLab Webhooks page. The 'Push events' menu item is highlighted in the 'Test' menu." />
Expand Down
Binary file modified images/gitlab/gitlab-config-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/gitlab/gitlab-config-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading