Use the edgeone command-line tool to deploy EdgeOne Pages static websites.
This plugin supports two usage modes: Settings Mode and Script Mode.
Pass parameters via settings, and the plugin will automatically execute the deployment command without manually writing scripts.
| Parameter | Required | Description | Default |
|---|---|---|---|
project_name | ✅ | EdgeOne Pages project name | - |
api_token | ✅ | EdgeOne Pages API Token | - |
directory | ❌ | Deployment directory path | . |
environment | ❌ | Deployment environment, preview for staging, empty for production | production |
tag_deploy.staging:
- imports: https://cnb.cool/***/-/blob/main/envs.yml
stages:
- name: build
image: node:20-alpine
script: npm install && npm run build
- name: Deploy to staging
image: tencentcom/deploy-eopages:latest
settings:
project_name: landing-page-demo
api_token: $EDGEONE_PAGES_API_TOKEN
directory: ./dist
environment: preview
tag_deploy.production:
- imports: https://cnb.cool/***/-/blob/main/envs.yml
stages:
- name: build
image: node:20-alpine
script: npm install && npm run build
- name: Deploy to production
image: tencentcom/deploy-eopages:latest
settings:
project_name: landing-page-demo
api_token: $EDGEONE_PAGES_API_TOKEN
directory: ./dist
Write custom edgeone commands directly using script, suitable for scenarios requiring flexible control over the deployment process.
tag_deploy.staging:
- imports: https://cnb.cool/***/-/blob/main/envs.yml
stages:
- name: build
image: node:20-alpine
script: npm install && npm run build
- name: Deploy my eo pages staging environment
image: tencentcom/deploy-eopages:latest
script: |
edgeone pages deploy ./dist -n landing-page-demo -e preview -t $EDGEONE_PAGES_API_TOKEN
tag_deploy.production:
- imports: https://cnb.cool/***/-/blob/main/envs.yml
stages:
- name: build
image: node:20-alpine
script: npm install && npm run build
- name: Deploy my eo pages production environment
image: tencentcom/deploy-eopages:latest
script: |
edgeone pages deploy ./dist -n landing-page-demo -t $EDGEONE_PAGES_API_TOKEN
EdgeOne Pages provides both staging and production environments, which perfectly align with CNB's custom deployment functionality. You can configure environments in .cnb/tag_deploy:
environments:
- name: staging
description: staging environment deployment
- name: production
description: production environment deployment
require:
- environmentName: staging
after: 60
API Token is sensitive information. It's recommended to store it in a secret repository and reference it in the pipeline:
# envs.yml
EDGEONE_PAGES_API_TOKEN: mRH1***wu0C