This project supports automatically packaging and deploying to Edgeone Pages on push.
Go to the Edgeone Pages console
Click Create Project - Upload Directly

Set the project name and select any template (it does not affect subsequent deployment, but it must be selected, otherwise you cannot proceed to the next step)

Click Start Deployment

After that, you can set the domain name yourself, refer to: https://edgeone.ai/zh/document/175201436224495616?product=edgedeveloperplatform
Create a new .cnb.yml, and configure the push section as follows:
push:
eo_deploy:
runner:
cpus: 32
stages:
- name: Build
image: node:20-alpine
script:
# This is the command required for nextjs build
- npm i -g pnpm
- pnpm i
- npm run build
- name: Deploy my eo pages production environment
imports:
# Import the Edgeone key here, you can click API Token to create a new one in the eopages console
# This is the import variable function provided by cnb, the file content is EO_SECRET: xxxxxxxxxxxxxxxxx
- Your key repository path
image: tencentcom/deploy-eopages:latest
# You need to use your EO_SECRET here, which has been explained above in imports
script: edgeone pages deploy ./out -n Your project name -t $EO_SECRET
You need to click APIToken in the EO Pages console to create a new Token for CNB deployment.

It is recommended to use the key repository method to import, creation and usage method: https://docs.cnb.cool/zh/repo/secret.html
This variable can be used as a parameter to pass when deploying the eopages production environment, which is more secure.
cnb.yml to the cnb configuration of the projecteo_deploy stage in .cnb.yml, as explained aboveoutput of the project next.config.ts to export to package static pages for deployment