Deploying from a CI/CD pipeline

Deploying to levv cloud from a CI/CD pipeline using Deploy Tokens #

Deploying to levv cloud from a CI/CD pipeline is streamlined through deploy tokens. These tokens enable automated access solely for deploying and removing applications. By creating a deployment token and securely storing it in your CI pipeline’s environment variables, you can easily manage application deployments through automation.

This guide walks you through generating a token, storing it securely in GitHub or GitLab CI, and setting up a job to apply your application configurations with levv apply.

1. Create a Deploy Token #

Generate a deployment token using the following command:

$ levv auth tokens create

The output will provide a TOKEN (starting with v4.), which you’ll need for authentication.

2. Store the Token in CI/CD Variables #

Add the token to your repository’s secrets or environment variables with the name LEVV_AUTH.

3. Create a Deployment Job #

In your pipeline configuration, add a step to apply your deployment using the stored token:

GitHub Actions:

- name: Deploy to levv
    run: |
        export LEVV_AUTH=${{ secrets.LEVV_AUTH }}
        levv apply -f myapp.yaml        

GitLab CI:

deploy:
    script:
        - export LEVV_AUTH=$LEVV_AUTH
        - levv apply -f myapp.yaml

This setup will authenticate the pipeline and deploy your configuration to levv cloud.