About
Static Web serves the files your build makes: HTML, CSS, JavaScript and images. Each th static-site deploy uploads a folder as a new release and makes it live; earlier releases stay so you can roll back. The first deploy of a new name creates the site.
- Build first (for example
npm run build) and deploy the output folder, the one that holdsindex.html(oftendist,buildorout). - Every file in the folder is uploaded (
.gitignoreis not read), except.git,.DS_Storeand paths listed in a.thignorefile. Up to 20,000 files and 500 MB (100 MB compressed) per deploy. - Sites connected to Git in the Console build on our side;
th static-site buildsstarts and follows those builds.
More in the help centre: How Static Web works.
How-to guides
Deploy a folder
- Build your site.
- Run
th static-site deploy NAME DIR. The first time, NAME becomes the site’s URL name (3–41 characters of a-z, 0-9 and -). - th prints the release and the site’s URL.
npm run build && th static-site deploy my-site distRoll back a release
th static-site releases my-site
th static-site rollback my-site previous* marks the live release. Use a release ID instead of previous to go back further.
Use your own domain
- Run
th static-site domains add my-site www.example.com. It prints the DNS records to create: aCNAMEto the site and aTXTrecord at_thailandhosting.www.example.comthat proves you own the domain. - Create the records at your DNS host. For an apex domain (
example.com) use your DNS host’s ALIAS/ANAME or CNAME flattening. - Run
th static-site domains verify my-site www.example.com. Once the TXT record is found, the domain serves the site over HTTPS.
Commands
| Command | Description |
|---|---|
th static-site deploy | Uploads a built folder (default ".") as the next release of a Static Web site. |
th static-site list | Lists the Static Web sites of the Project. |
th static-site describe | Shows a Static Web site: URL, source, active release and latest build. |
th static-site releases | Lists a Static Web site's releases, newest first. |
th static-site rollback | Makes an earlier release live again. |
th static-site domains add | Adds a custom domain and prints the DNS records that prove you own it. |
th static-site domains verify | Checks the domain's TXT record and turns the domain on. |
th static-site domains list | Lists a Static Web site's custom domains. |
th static-site domains remove | Removes a custom domain from the site. |
th static-site builds list | Lists the Git builds of a Static Web site, newest first. |
th static-site builds log | Prints a Git build's log. |
th static-site builds trigger | Starts a Git build of the site's branch. |
th static-site delete | Deletes a Static Web site with all its releases and domains. |
th static-site deploy
Uploads a built folder (default ".") as the next release of a Static Web site.
Syntax
th static-site deploy NAME [DIR]The site is created first when NAME does not exist yet (NAME becomes its URL name: 3–41 characters a-z, 0-9 and -), in --region or the default region.
Every file in DIR is uploaded — .gitignore is not read, since build output is often gitignored — except .git, .DS_Store and paths listed in a .thignore file in DIR. Up to 20,000 files, 500 MB (100 MB compressed) per deploy.
Examples
Build, then deploy the dist folder
npm run build && th static-site deploy my-site distDeploy ./public as the site docs, created in bkk
th static-site deploy docs ./public --region bkkPositional arguments
| Name | Description |
|---|---|
NAMERequired | The site’s URL name (3–41 characters of a-z, 0-9 and -). |
DIROptional | The folder to upload (default: the current folder). |
Global parameters
This command also takes the global parameters: --project, --region, --endpoint, --format, --quiet.
th static-site list
Lists the Static Web sites of the Project.
Syntax
th static-site listExamples
List the Project’s sites
th static-site listGlobal parameters
This command also takes the global parameters: --project, --region, --endpoint, --format, --quiet.
th static-site describe
Shows a Static Web site: URL, source, active release and latest build.
Syntax
th static-site describe NAMEExamples
URL, source, live release and latest build
th static-site describe my-sitePositional arguments
| Name | Description |
|---|---|
NAMERequired | The site’s URL name (3–41 characters of a-z, 0-9 and -). |
Global parameters
This command also takes the global parameters: --project, --region, --endpoint, --format, --quiet.
th static-site releases
Lists a Static Web site's releases, newest first.
Syntax
th static-site releases NAME* marks the live one.
Examples
List releases; * marks the live one
th static-site releases my-sitePositional arguments
| Name | Description |
|---|---|
NAMERequired | The site’s URL name (3–41 characters of a-z, 0-9 and -). |
Global parameters
This command also takes the global parameters: --project, --region, --endpoint, --format, --quiet.
th static-site rollback
Makes an earlier release live again.
Syntax
th static-site rollback NAME RELEASE|previous"previous" is the release before the live one.
Examples
Go back one release
th static-site rollback my-site previousMake a specific release live
th static-site rollback my-site <release-id>Positional arguments
| Name | Description |
|---|---|
NAMERequired | The site’s URL name (3–41 characters of a-z, 0-9 and -). |
RELEASE|previousRequired | A release ID from th static-site releases, or previous for the release before the live one. |
Global parameters
This command also takes the global parameters: --project, --region, --endpoint, --format, --quiet.
th static-site domains add
Adds a custom domain and prints the DNS records that prove you own it.
Syntax
th static-site domains add NAME DOMAINExamples
Add a domain and print its DNS records
th static-site domains add my-site www.example.comPositional arguments
| Name | Description |
|---|---|
NAMERequired | The site’s URL name (3–41 characters of a-z, 0-9 and -). |
DOMAINRequired | A custom domain such as www.example.com. |
Global parameters
This command also takes the global parameters: --project, --region, --endpoint, --format, --quiet.
th static-site domains verify
Checks the domain's TXT record and turns the domain on.
Syntax
th static-site domains verify NAME DOMAINExamples
Check the TXT record and turn the domain on
th static-site domains verify my-site www.example.comPositional arguments
| Name | Description |
|---|---|
NAMERequired | The site’s URL name (3–41 characters of a-z, 0-9 and -). |
DOMAINRequired | A custom domain such as www.example.com. |
Global parameters
This command also takes the global parameters: --project, --region, --endpoint, --format, --quiet.
th static-site domains list
Lists a Static Web site's custom domains.
Syntax
th static-site domains list NAMEExamples
List the site’s domains
th static-site domains list my-sitePositional arguments
| Name | Description |
|---|---|
NAMERequired | The site’s URL name (3–41 characters of a-z, 0-9 and -). |
Global parameters
This command also takes the global parameters: --project, --region, --endpoint, --format, --quiet.
th static-site domains remove
Removes a custom domain from the site.
Syntax
th static-site domains remove NAME DOMAIN [--quiet]Examples
Remove a domain
th static-site domains remove my-site www.example.comPositional arguments
| Name | Description |
|---|---|
NAMERequired | The site’s URL name (3–41 characters of a-z, 0-9 and -). |
DOMAINRequired | A custom domain such as www.example.com. |
Global parameters
This command also takes the global parameters: --project, --region, --endpoint, --format, --quiet.
th static-site builds list
Lists the Git builds of a Static Web site, newest first.
Syntax
th static-site builds list NAMEExamples
List Git builds
th static-site builds list my-sitePositional arguments
| Name | Description |
|---|---|
NAMERequired | The site’s URL name (3–41 characters of a-z, 0-9 and -). |
Global parameters
This command also takes the global parameters: --project, --region, --endpoint, --format, --quiet.
th static-site builds log
Prints a Git build's log.
Syntax
th static-site builds log NAME BUILD [--follow]BUILD is its ID, its number (#3 or 3) or "latest".
Examples
Follow the newest build
th static-site builds log my-site latest --followPositional arguments
| Name | Description |
|---|---|
NAMERequired | The site’s URL name (3–41 characters of a-z, 0-9 and -). |
BUILDRequired | A Git build: its ID, its number (#3 or 3) or latest. |
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
--follow | flag | Keep printing until the build finishes |
Global parameters
This command also takes the global parameters: --project, --region, --endpoint, --format, --quiet.
th static-site builds trigger
Starts a Git build of the site's branch.
Syntax
th static-site builds trigger NAMEExamples
Build the site’s branch now
th static-site builds trigger my-sitePositional arguments
| Name | Description |
|---|---|
NAMERequired | The site’s URL name (3–41 characters of a-z, 0-9 and -). |
Global parameters
This command also takes the global parameters: --project, --region, --endpoint, --format, --quiet.
th static-site delete
Deletes a Static Web site with all its releases and domains.
Syntax
th static-site delete NAME [--quiet]--quiet skips the prompt.
Examples
Delete the site, its releases and domains
th static-site delete my-sitePositional arguments
| Name | Description |
|---|---|
NAMERequired | The site’s URL name (3–41 characters of a-z, 0-9 and -). |
Global parameters
This command also takes the global parameters: --project, --region, --endpoint, --format, --quiet.