Skip to main content

Deployment Methods

Static website hosting supports three deployment methods: uploading code packages/folders, creating from official templates, and Git repository deployment. This document introduces how to use these deployment methods, configure build commands, set deployment paths, and deployment solutions for common frontend frameworks.

Quick Start

Deployment Entry

Go to CloudBase Console - Static Website Hosting

Deployment Methods

Method 1: Upload Code Package/Folder

Use case: You already have project code locally and want to deploy quickly.

Upload Code Package

Prepare code package:

Supports uploading code packages in the following formats:

  • .zip format (recommended)

Code package requirements:

  • The code package should contain the complete frontend project source code

Deployment steps:

  1. On the "Static Website Hosting" page, click "New Deployment"
  2. Select "Upload Code Package"
  3. Click "Select File" to upload a local ZIP file
  4. Configure build parameters See below for details
  5. Click "Deploy"

Upload Folder

Deployment steps:

  1. On the "Static Website Hosting" page, click "New Deployment"
  2. Select "Upload Folder"
  3. Select the local project folder
  4. Configure build parameters (see below for details)
  5. Click "Start Deployment"
Tip

Before uploading the code package, you can delete common unnecessary directories such as node_modules, .git, etc., to avoid excessively large uploads that may cause upload failures.

Method 2: Create from Official Template

Use case: Quickly create new projects and develop based on best practice templates.

Supported official templates:

  • React Template: Standard React project created based on Create React App
  • Vue Template: Standard Vue 3 project created based on Vue CLI

Deployment steps:

  1. On the "Static Website Hosting" page, click "New Deployment"
  2. Select "Create from Template"
  3. Select template type (React or Vue)
  4. Configure build parameters See below for details
  5. Click "Deploy"

Template features:

  • ✅ Ready to use out of the box, no configuration needed
  • ✅ Integrated best practices
  • ✅ Automatically configured build commands
  • ✅ Supports online modification and redeployment

Method 3: Git Repository Deployment

Use case: Continuous integration, automatically trigger deployment when code is updated.

Supports direct deployment from your Git repository:

  • GitHub
  • GitLab
  • Gitee (码云)
  • 腾讯工蜂

Deployment steps:

  1. On the "Static Website Hosting" page, click "New Deployment"
  2. Select "Git Repository"
  3. Select "Personal Repository"
  4. Authorize access to your Git platform account
  5. Select the repository and branch to deploy
  6. Configure build parameters
  7. Click "Deploy"

Public Repository

Supports deployment from any public Git repository:

Deployment steps:

  1. On the "Static Website Hosting" page, click "New Deployment"
  2. Select "Git Repository"
  3. Select "Public Repository"
  4. Enter the repository URL (e.g., https://github.com/username/repo.git)
  5. Select branch (default main or master)
  6. Configure build parameters
  7. Click "Deploy"