Deploy a Static Site
This guide will walk you through creating and deploying your first static site on Worktree Cloud.
Prerequisites
- A Worktree account
- A Worktree Cloud Organization
- A static site codebase (eg., Hugo, 11ty, etc.)
Step 1: Create a Site
- In the Worktree Cloud Console, click on "Sites", and click "Create Site".
- 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.
Currently there is a single official method to do this, Worktree Actions. 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.
Addendum: Deploying Manually
If you want to build your own deploy process and not use the official Worktree Action, you can absolutely do so. The Sites deploy process is intentionally very simple: at a minimum it consists of three API calls:
- Create a version
- Upload a file
- "Seal" the version, marking it read-only and promoting it to production.
The worktree/deploy-site
action is itself just a shell script which uses
curl
to make these API requests for you. It should be straightforward to
reverse-engineer for your own purposes if you wish to deploy using your own
tooling.