> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Inject secrets into GitLab CI/CD pipelines

> Fetch secrets from Infisical in GitLab CI/CD pipelines.

Prerequisites:

* Set up and add envars to [Infisical Cloud](https://app.infisical.com).

> [accordion] Standard
>
> Use our [GitLab Secret Syncs](https://infisical.com/docs/integrations/secret-syncs/gitlab.md)

> [accordion] Pipeline
>
> **1. Authorize Infisical for GitLab**
>
> Generate an [Infisical Token](https://infisical.com/docs/documentation/platform/token.md) for the specific project and environment in Infisical.
>
> Next, create a new variable called `INFISICAL_TOKEN` with the value set to the token from the previous step in Settings > CI/CD > Variables of your GitLab repository.
>
> **2. Configure Infisical in your pipeline**
>
> Edit your `.gitlab-ci.yml` to include the Infisical CLI installation. This will allow you to use the CLI for fetching and injecting secrets into any script or command within your GitLab CI/CD process.
>
> #### Example
>
> ```yaml theme={"dark"}
> image: ubuntu
>
> stages:
>   - build
>   - test
>   - deploy
>
> build-job:
>   stage: build
>   script:
>     - apt update && apt install -y curl
>     - curl -1sLf 'https://artifacts-cli.infisical.com/setup.deb.sh' | bash
>     - apt-get update && apt-get install -y infisical
>     - infisical secrets-manager run -- npm run build
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.