All Products
Search
Document Center

:Set up continuous deployment for Function Compute

Last Updated:Apr 15, 2026

If you have already deployed functions to Function Compute, you know that manually updating code and configurations for each release is a tedious, error-prone process. To improve the deployment experience and reduce the risks of manual intervention, you can use Serverless Application Center to set up a continuous deployment pipeline for your existing Function Compute projects. Serverless Application Center provides customizable pipelines with programmable, automated build and release capabilities, as well as manual approval steps, to help you build and deploy your projects on the cloud.

Prerequisites

  • You have created a function.

    This topic demonstrates the deployment steps in Serverless Application Center using a Node.js application as an example.

  • Your function code is managed with Git.

    The example in this topic uses a function with its code hosted in a GitHub repository.

Step 1: Prepare build commands and check tool versions

Prepare the build commands

You must provide the specific commands to build and package your function, just as you would on your local machine. Note that build methods may differ between a local Windows environment and the cloud-based Linux environment. For more information about how to correctly develop and build functions, see Code development overview.

The sample commands below illustrate a local build process. Prepare the commands specific to your function's code, as you will need them when you configure the pipeline in Serverless Application Center.

# Use the npm tool to build the project. This is typically the install command, but you can add custom steps if needed.
# The commands must fulfill all build requirements.
npm install ./code --production --registry=https://registry.npmmirror.com
# Use the zip command to package your code. The Serverless Devs tool also supports automatic zipping.
# We recommend using the zip command to prevent unintended files from being included in the package.
# This command packages the code and places the compressed file in the root directory. You can also place it in a different location.
zip code.zip -r ./code/*

Check the build tool version

Serverless Application Center provides multiple versions of build tools in its build environment, allowing you to switch between them as needed. This topic uses Node.js 16. You will need to specify this build tool version when you configure the pipeline.

Step 2: Prepare the s.yaml file

You can use an s.yaml configuration file to define your function and its resources. Place the s.yaml file in your code repository and use the Serverless Devs tool for deployment.

For functions already deployed in Function Compute, follow these steps to prepare the s.yaml file:

  1. Log on to the Function Compute console. In the left-side navigation pane, click Functions.

  2. In the top navigation bar, select a region. On the Functions page, click the function that you want to manage.

  3. On the Function Details page, click the Code tab, and then choose . In the Export Configuration dialog box, click OK to download the s.yaml file to your local computer.

  4. Modify the s.yaml file, place it in the root directory of your project, and then commit it to your Git repository.

    The following figure shows the contents of the downloaded s.yaml file. You need to make the following changes:

    1. Remove the access: '{{ access }}' line.

    2. Change the value of codeUri to the actual path of your build artifacts, such as ./code.zip. For more information about the path of build artifacts, see Prepare the build commands.

    image.png

If you need to define multiple functions, you must export the s.yaml file for each function and then merge them. For more information about the s.yaml specification and how to declare multiple functions, see YAML syntax and permission management.

Step 3: Create an application

  1. Log on to the Function Compute console. In the left-side navigation pane, choose Applications. On the Applications page, click Create Application.

  2. On the Create Application page, select Import an Application from a Repository, set Repository Type to GitHub, and then configure your repository settings.

    If you have not yet authorized Serverless Application Center to access your account, follow the on-screen instructions to log on to the GitHub console and grant the required permissions.

  3. In the Environment Configurations section, use the following settings for this example:

    • Pipeline Configuration Plan: Custom Configuration.

    • Application Deployment and Trigger Mode: Push to the specified branch trigger.

    • Select a Pipeline Environment: Default Environment.

  4. After configuring the parameters, click Create and Deploy Default Environment to create the application.

Step 4: Configure the pipeline

The initial deployment of the application may fail. You will need to modify the build and deployment tasks in the pipeline to ensure the project builds correctly. For more information about pipelines and how to use them, see Concepts and Manage pipelines.

On the application details page, click the Pipeline Management tab. In the Pipeline Details section, modify the YAML file and then click Save. The following list describes the modifications made in this example.

image.png

Step 5: Verify continuous deployment

Push your code changes to the master branch of your repository. This action triggers the pipeline, which automatically deploys the changes to Function Compute.

  • You can view the execution details on the Pipeline Management tab in the Pipeline Execution History section.

    image.png

  • You can verify the code update on the function resource deployed by Serverless Application Center.

    Note

    You cannot view code updates for functions that do not support online editing.

    On the Environment Details tab, find your function in the Resource Information section and click its name. On the function details page, click the Code tab to view the updated code from the Git push.

Related documents