Skip to main content

Deploy a Static Site

This guide will walk you through creating and deploying your first static site on Worktree Cloud.

Prerequisites

Step 1: Create a Site

  1. In the Worktree Cloud Console, click on "Sites", and click "Create Site".
  2. Provide a site name. This will be used as the subdomain, so must be DNS-compliant (lowercase, alphanumeric and hyphens only).

Step 2: Deploy your Site

Now that you have a Site, you can deploy your static files.

Option 1: With the Worktree CLI

You can deploy your site right from your local machine with a single command using the the Worktree Cloud CLI, wtc.

First, make sure you have set up and authorized the CLI.

If your site has a build step, run it.

Then, you can deploy the static files with wtc deploy (where ./dist is the path to your site output):

wtc deploy --site-id <your_site_id> ./dist

To make things easier, you can add a .worktree/deploy.yaml file to your repository, which wtc will read automatically:

type: static-site
siteID: <your_site_id>
siteSource: ./dist

With this file, now you only need to run:

wtc deploy

Option 2: With Worktree Actions

For automated deployments with CI, we publish an official Action, worktree/deploy-site, which can deploy your static assets automatically in your Actions workflow—perfect if your static site has a build process.

More information on how to use worktree/deploy-site can be found in the CI/CD integration guide.

Step 3: Visit your Site

Once deployed, your site will be available within 120 seconds on its subdomain endpoint: {name}.worktree.site.

For production websites, we recommend adding a custom CDN Endpoint to your site, which allows mapping a custom domain with automatic TLS certificates and intelligent edge caching. Learn more in the CDN guide.

Next Steps