Edge Developer Platform
  • Pages
    • Product Introduction
    • Quick Start
      • Agent Development
      • Importing a Git Repository
      • Starting From a Template
      • Direct Upload
      • Start with AI
    • Framework Guide
      • Agent
      • Frontends
        • Vite
        • React
        • Vue
        • Hugo
        • Other Frameworks
      • Backends
      • Full-stack
        • Next.js
        • Nuxt
        • Astro
        • React Router
        • SvelteKit
        • TanStack Start
        • Vike
      • Custom 404 Page
    • Project Guide
      • Project Management
      • edgeone.json
      • Configuring Cache
      • Building Output Configuration
      • Error Codes
    • Build Guide
    • Deployment Guide
      • Overview
      • Create Deploys
      • Manage Deploys
      • Deploy Button
      • Using Github Actions
      • Using Gitlab CI/CD
      • Using CNB Plugin
      • Using IDE PlugIn
      • Using CodeBuddy IDE
    • Domain Management
      • Overview
      • Custom Domain
      • HTTPS Configuration
        • Overview
        • Apply for Free Certificate
        • Using Managed SSL Certificate
      • Configure DNS CNAME Record
    • Observability
      • Overview
      • Metric Analysis
      • Log Analysis
    • Functions
      • Overview
      • Edge Functions
      • Cloud Functions
        • Overview
        • Node.js
        • Python
        • Go
    • Agents
      • Overview
      • Quick Start
      • Conversation Storage
      • Observability
      • Sandbox Tool
        • Overview
        • Using the Agent Framework
        • Sandbox Atomic API
        • Network Search Tool
      • Agent Authentication
    • Models
      • Overview
      • Models and Vendors
        • Overview
        • Using Vendor Keys
          • OpenAI
          • Anthropic
          • Google AI Studio
          • DeepSeek
          • MiniMax
          • Hunyuan
          • Zhipu
          • MoonShot AI
      • FAQs
    • Storage
      • Overview
      • KV
      • Blob
    • Middleware
    • AI-Native Development
      • Skills
      • MCP
    • Copilot
      • Overview
      • Quick Start
    • API Token
    • EdgeOne CLI
    • Message Notification
    • Integration Guide
      • AI
        • Dialogue Large Models Integration
        • Large Models for Images Integration
      • Database
        • Supabase Integration
        • Pages KV Integration
      • Ecommerce
        • Shopify Integration
        • WooCommerce Integration
      • Payment
        • Stripe Integration
        • Integrating Paddle
      • CMS
        • WordPress Integration
        • Contentful Integration
        • Sanity Integration
        • Payload Integration
      • Authentication
        • Supabase Integration
        • Clerk Integration
    • Best Practices
      • Adding an AI Chat Assistant to a Website
      • AI Dialogue Deployment: Deploy Project with One Sentence Using Skill
      • Using General Large Model to Quickly Build AI Application
      • Use the DeepSeek model to quickly build a conversational AI site
      • Building an Ecommerce Platform with Shopify
      • Building a SaaS Site Using Supabase and Stripe
      • Building a Company Brand Site Quickly
      • How to Quickly Build a Blog Site
    • Migration Guides
      • Migrating from Vercel to EdgeOne Pages
      • Migrating from Cloudflare Pages to EdgeOne Pages
      • Migrating from Netlify to EdgeOne Pages
    • Troubleshooting
    • FAQs
    • Limits
    • Pricing
    • Contact Us
    • Release Notes

Using Gitlab CI/CD

By following the guidelines in this section, you can use GitLab CI/CD to automatically build and deploy your project to EdgeOne Makers.

Configure GitLab CI/CD Variables

1. Enter the GitLab warehouse page, click in the left menu Settings > CI/CD.
2. Unfold the Variables part and click Add variable.
3. Configure the following variables:
Key: EDGEONE_API_TOKEN
Value: API Token obtained from the EdgeOne Makers console
Type: Variable
Flags: Check Mask variable (hide variable value) and Protect variable (Option, only for protected branch usage)
Refer to the document API Token for EDGEONE_API_TOKEN retrieval.

Create a GitLab CI/CD Configuration File

Create a file named .gitlab-ci.yml in the root directory of your GitLab repository and add the following content:
stages:
- deploy

variables:
PROJECT_NAME: "my-project" # change to your project name

# Cache node_modules to speed up builds (Option)
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/

# Scenario 1: Deploy preview URL before code merge (Preview)
# Trigger when a Merge Request is generated
deploy-preview:
image: node:22.11.0 # Select a suitable Node.js version
stage: deploy
only:
- merge_requests
script:
- npm install
- npm run build
- npx edgeone makers deploy -n $PROJECT_NAME -t $EDGEONE_API_TOKEN -e preview

# Scenario 2: Deploy trunk code change (Production)
# Trigger when code is pushed to the main branch
deploy-production:
image: node:22.11.0 # Select a suitable Node.js version
stage: deploy
only:
- main
script:
- npm install
- npm run build
- npx edgeone makers deploy -n $PROJECT_NAME -t $EDGEONE_API_TOKEN -e production

Configuration Instructions

EdgeOne CLI Deployment Command

npx edgeone makers deploy -n <project-name> -t <API_TOKEN> -e <environment>
Parameter
Description
-n <project name>
EdgeOne Makers project name. If the project does not exist, it will be created automatically.
-t <API_TOKEN>
EdgeOne Makers API Token
-e <environment>
Deployment environment, selectable preview (Preview) or production (Production)

Deployment Scenario Description

Scenario
Trigger Condition
Environment Parameter
Description
preview deployment
Merge Request
-e preview
Each time an MR is generated, an independent preview URL is created for code review to view the effect
production deployment
push to the main branch
-e production
After code merge, automatic deployment to the production environment is used for official release, with high traffic and stability requirements.

Workflow

After the configuration is complete, GitLab CI/CD will automatically execute the following process:

Preview Environment (Merge Request)

1. Trigger Condition: Automatically trigger when creating or updating a Merge Request.
2. Execution Process: Dependency installation → Build project → Deploy to preview environment
3. Result: Generate a preview URL, which can be viewed in the MR to see the effect.

Production Environment (Main Branch)

1. Trigger Condition: Automatically trigger when code is pushed to the main branch.
2. Execution Process: Dependency installation → Build project → Deploy to production environment
3. Result: Update the production environment site

View Deployment Result

1. On the GitLab warehouse page, click Build > Pipelines in the left menu to view the pipeline status.
2. Click on the pipeline to view stage execution details.
3. After a successful deployment, access the EdgeOne Makers console to view the deployed project and its access URL.

FAQs

Q: Pipeline Execution Failed with a Permission Error Notification?

A: Please check whether the EDGEONE_API_TOKEN variable is configured correctly and ensure the TOKEN is not expired.

Q: How to Deploy to an Existing Project?

A: Specify the name of an existing project using the -n parameter in the deployment command, and the deployment for that project will be updated automatically.

References