Edge Developer Platform
  • Pages
    • Product Introduction
    • Quick Start
      • Importing a Git Repository
      • Starting From a Template
      • Direct Upload
    • Framework Guide
    • Project Guide
      • Project Management
      • edgeone.json
      • Configuring Cache
      • Error Codes
    • Build Guide
    • Deployment Guide
      • Overview
      • Create Deploys
      • Manage Deploys
      • Deploy Button
      • Use Github Actions
      • Using CNB Plugin
    • Domain Management
      • Overview
      • Custom Domain Name
      • Configuring an HTTPS Certificate
      • How to Configure a DNS CNAME Record
    • Pages Functions
    • KV Storage
    • Edge AI
    • API Token
    • EdgeOne CLI
    • Pages MCP
    • Integration Guide
      • Database
        • Supabase Integration
        • Pages KV Integration
      • Ecommerce
        • Shopify Integration
        • WooCommerce Integration
      • Payment
        • Stripe Integration
        • Integrating Paddle
      • CMS
        • WordPress Integration
        • Contentful Integration
        • Sanity Integration
      • Authentication
        • Supabase Integration
        • Clerk Integration
    • Best Practices
      • Use the Deepseek-R1 model to quickly build a conversational AI site
      • Building an Ecommerce Platform with WordPress + WooCommerce and GatsbyJS
      • 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
    • Contact Us
    • Release Notes

Use Github Actions

Follow the guide in this section, you can quickly integrate Actions workflows in your Github repository to enable automated build and deploy to EdgeOne Pages.


Set Github Repository Secret

To run this Action, you need to create a Secret in your GitHub repository:
access your GitHub repository page
go to "Settings" > "Secrets and variables" > "Actions"
Click "New repository secret"
Enter EDGEONE_API_TOKEN in "Name" Enter the value of EdgeOne API token in "Secret"

For obtaining EDGEONE_API_TOKEN, refer to the document API Token.

The complete .github/workflows/deploy.yml configuration is as follows:
name: Build and Deploy

on:
push:
branches:
- main

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.11.0' # Select a suitable Node.js version
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build
- name: Deploy to EdgeOne Pages
run: npx edgeone pages deploy <outputDirectory> -n <projectName> -t ${{ secrets.EDGEONE_API_TOKEN }} [-e <env>]
env:
EDGEONE_API_TOKEN: ${{ secrets.EDGEONE_API_TOKEN }}
Note:
npx edgeone pages deploy Parameter description:
<outputDirectory>: The folder where the project building product resides (required)
-n, --name: The name of the project to be deployed. If the project does not exist, a new project will be created automatically (required)
-e, --env: Target deployment environment, available values: production or preview (default: production)

Note: Example: npx edgeone pages deploy ./dist -n project-name -t ${{ secrets.EDGEONE_API_TOKEN }}



Building with GitHub Actions

Place the deploy.yml file configuration in your project root directory. When code is pushed to the main branch, the following build process will be triggered:
1. checkout to the target repository
2. Set Node.js version to 22.11.0
3. Install project dependencies
4. Build project


Deploy with EdgeOne Pages

After build complete, the project will be deployed to EdgeOne Pages via the following steps:
Generate the ./out directory during the build stage
Use EdgeOne command line tool to perform deployment: npx edgeone pages deploy ./out -n my-edgeone-pages-project -t ${{ secrets.EDGEONE_API_TOKEN }}

Related documentation for Github Action: https://docs.github.com/en/actions