Skip to main content

Not just building the frontend,
reliably delivering it.

Host SPAs, marketing sites, docs, and static assets over CDN and HTTPS, then bind custom domains and routing rules for production.

Build · Hosting · CDN
hosting / productionpublished
cloudbase-website
01 · Build

npm run build

Docusaurus · 148 pages

02 · Upload

Static artifacts

HTML · CSS · JS · Images

03 · Deliver

Custom domain

HTTPS · CDN · Route rewrite

assetcachestate
/index.htmlno-cachepublished
/assets/app.8f31.jsimmutableedge ready
/products/database/html200
From commit to edge

Build, verify, and deploy on one release path

The pipeline produces reproducible static files first, then deploys the same artifacts to the target environment — domains and CDN only deliver verified output.

publish pipelineall checks passed
01 · Commit

Frontend code lands on main

Git push · CI trigger

02 · Verify

Install, build, and verify

npm ci · npm run build

03 · Publish

Deploy static artifacts

Hosting · CDN · Domain

jobresultstate
build:websitezh-Hans · enpassed
broken-links0 errorspassed
deploy:hostingdist → /published

Delivery primitives for shipping frontend

From static files to user domains — artifacts, routing, certificates, caching, and automated release.

01

Static artifact hosting

Host HTML, CSS, JavaScript, images, and downloads directly — ideal for SPAs, marketing sites, docs, and static assets.

STATIC
02

CDN and HTTPS

Assets cache at CDN edge nodes; default entry points include HTTP and HTTPS with no web server to run.

DELIVERY
03

Custom domains

Bind business domains with the right CDN type, certificates, and DNS so users reach your site through a stable entry.

DOMAIN
04

SPA route fallback

When React Router or Vue Router uses history mode, rewrite unmatched paths to index.html.

REWRITE
05

Frontend framework builds

Build React, Vue, Angular, VitePress, Astro, and more online; Next.js is limited to static export.

FRAMEWORK
06

CLI and CI/CD

Upload existing artifacts locally, or install dependencies, build, verify, and deploy in continuous integration.

AUTOMATION
Static hosting is not just uploading files — every build should have clear artifacts, a fixed entry, and a repeatable delivery process.
Product design principle
A domain is the product entrance

Design domain, HTTPS, CDN, and routing together

Define root and subpath boundaries first, then configure domains, caching, and rewrites — avoid retrofitting routing after pages ship.

View custom domains
REQUEST ROUTE
domainCustom domain
transportHTTP / HTTPS
deliveryCDN edge cache
fallbackSPA route rewrite

From local build to pipeline release

Examples cover existing hosting and CLI capabilities; this docs site's production pipeline will be added separately at launch.

Reproducible build

Make the framework output a fixed static directory

Vite base must match the deploy path; other static generators should also fix output directory and asset prefix explicitly.

  • Use / for base when deploying to root
  • Keep leading and trailing slashes for subpath deploys
  • Use CloudRun for SSR or server-side processes
vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
  base: '/',
  build: {
    outDir: 'dist'
  }
})

// npm run build
// dist/index.html + dist/assets/*
CLI deployment

Upload verified artifacts to the target environment

hosting deploy does not install or build — it uploads a directory only, so pipelines can run their own quality gates before deploy.

  • Specify target environment with -e
  • Optional cloudPath for subpath deploys
  • Domain cutover should not replace artifact verification
deploy.sh
# Sign in and select the target environment
tcb login

# Build with your project's own scripts
npm ci
npm run build

# Deploy static artifacts to the root path
tcb hosting deploy dist -e <env-id>
Continuous delivery

Pin Node, build, and deploy steps in CI

Credentials come from pipeline secrets, not the repo; the example shows capability structure without creating real deploy jobs locally.

  • npm ci keeps dependencies reproducible
  • Build and verify before installing CLI to deploy
  • Use separate env vars for dev, staging, and production
deploy.yml
name: deploy-website
on:
  push:
    branches: [main]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: npm
      - run: npm ci
      - run: npm run build
      - run: npm install -g @cloudbase/cli
      - run: tcb hosting deploy dist -e "$TCB_ENV_ID"
Frontend ecosystem

One hosting entry for many static frontends

If the final output is static files, it can follow the same build and delivery flow.

01

Single-page apps

React, Vue, Angular, and other SPAs.

02

Content sites

Docusaurus, VitePress, Hugo, and Hexo.

03

Product sites

Marketing sites, campaign pages, component docs, and downloads.

ReactVueAngularViteDocusaurusVitePressAstroHugoHexoStatic ExportCDNHTTPSCustom DomainCI/CD
Publish your frontend

Green your local build, then wire up production release

Confirm output directory, asset prefix, and routing behavior, then deliver the same artifacts via CLI or pipeline.