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 the README.md file in your repository:
[](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
Necessary environment variables for the repository. If needed, multiple variables can be connected with English commas, such as: KEY1,KEY2,KEY3.
env-description
Description related to environment variables
env-link
URLs related to environment variables
Notes:
The parameter value needs to be encoded using encodeURIComponent() before being concatenated into the URL. For example, 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 page will be redirected to the Pages console.
2. The GitHub repository will be used as the default deployment source.
3. Support adjustments to the project's configuration items.
4. Click "Create". After that, 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 the edgeone.json document. You can customize the buildCommand, installCommand, and outputDirectory of your project. It is recommended to configure these parameters according to the actual situation of the project to ensure that others can build and deploy your project correctly.