This section will introduce how to add a one-click deploy button in a GitHub repository, allowing users to quickly deploy your template to EdgeOne Pages.
Deploy Button
The deploy button for Pages is as follows:
When the user clicks this button, they will be guided to Pages, and your warehouse will be preconfigured as the deployment source.
How to Add a Deploy Button
Add the following Markdown code to your repository's README.md file:
[](https://edgeone.ai/pages/new?repository-url=YOUR_REPO_URL)
Replace YOUR_REPO_URL with your GitHub repository URL. Subpaths are supported. For example:
[](https://edgeone.ai/pages/new?repository-url=https%3A%2F%2Fgithub.com%2FTencentEdgeOne%2Fpages-templates%2Ftree%2Fmain%2Fexamples%2Fvue-template)
URL Search Parameter
The deploy button URL supports the following Search parameters:
Search Parameter Name
Description
template
Template name deployed by Pages official template
repository-name
GitHub Repository Name
repository-url
Repository address deployed by other GitHub repositories
project-name
Project Name
build-command
Build command
install-command
Installation command
output-directory
Output directory for post-build products
root-directory
Build root directory
env
Required environment variables for the repository. If needed, use commas to separate multiple variables, for example, KEY1,KEY2,KEY3.
env-description
Description related to environment variables
env-link
URLs related to environment variables
Notes:
The parameter value needs to use encodeURIComponent() after encoding before being concatenated into the URL, such as build-command=npm%20run%20build.
Examples
For public GitHub repositories:
[](https://edgeone.ai/pages/new?repository-url=https%3A%2F%2Fgithub.com%2Fusername%2Frepository)
For a specific branch:
[](https://edgeone.ai/pages/new?repository-url=https%3A%2F%2Fgithub.com%2Fusername%2Frepository%2Ftree%2Fbranch-name)
How to use URL Search Parameter:
[](https://edgeone.ai/pages/new?repository-url=https%3A%2F%2Fgithub.com%2FTencentEdgeOne%2Fpages-templates%2Ftree%2Fmain%2Fexamples%2Fvue-template&output-directory=.%2Fdist&install-command=npm%20install&build-command=npm%20run%20build)
User Experience
When the user clicks the Deploy Button:
1. The webpage will be redirected to the Pages console.
2. The GitHub repository will be deployed to default.
3. Support adjustments to project configuration items.
4. Click Create now, and the project will be deployed to Pages.
This provides a seamless experience for users who want to quickly try or deploy your template.
More Configurations
Refer to edgeone.json, you can customize the build command, install command and output directory of your project. It is recommended to configure these parameters based on the actual situation to ensure others can correctly build and deploy your project.