Publishing

How it works

Every publish starts with a local file hash. The tool walks your directory, computes an MD5 for each file, and sends the full manifest to the server. The server diffs it against your site’s existing content and hands back upload URLs for only the files that changed. Everything else is copied server-side from the previous version. Those files never leave your machine again.

This matters on large sites. Republish a 200-file project after changing three CSS files, and three files upload. The other 197 are server-side copies, done in milliseconds.

Upload sessions are valid for 6 hours. If you’re uploading a very large file on a slow connection and the session expires, just start a new publish. It’ll compute a fresh manifest.

What gets excluded

Publish the build output: the folder with index.html in it. Two checks run before a single byte uploads.

  • No index.html at the top? Publish stops, because the site would have no home page.
  • Looks like a project root? Two or more repo signals (package.json, tsconfig.json, a lockfile, Dockerfile, src/, .git/) and publish stops, rather than putting your source code on the web.

Either way, the message names any build folder (dist/, build/, out/, public/, _site/) that has an index.html, so your agent usually just publishes that instead. One stray file, like a lone package.json or a .sh script, only gets a warning.

Some things never ship, whatever folder you pick:

  • Directories: .git/, node_modules/, .svn/, .hg/, .ssh/, .aws/
  • Files: .DS_Store, Thumbs.db, .upublishignore, .env, .env.*, .envrc, .npmrc, .netrc, .pypirc, credentials.json, secrets.*, *.pem, *.key, *.p12, *.pfx, and SSH keys (id_rsa*, id_ed25519*, id_ecdsa*, id_dsa*)
  • Source maps (*.map), unless you ask for them

Meant it? Say so, and your agent passes the matching option: allow_no_index for a folder that isn’t a web page, allow_project_files for a project folder you really want public, include_sourcemaps to ship the maps. The secrets list has no override.

publish ./downloads as files, it has no index page and that's fine

To add your own exclusions, put a .upublishignore file in the directory you’re publishing:

# Raw exports the pages don't load
*.csv

# Large reference data that's fetched separately
data/

# The README is for contributors, not visitors
README.md

Patterns support exact filenames, directory names (trailing /), and extensions (*.ext). The ignore file itself is always excluded from the upload.

publish dist as my-portfolio, skip any csv files

If the directory you’re publishing is a build output folder (like dist/ or out/), you generally don’t need an ignore file. The build process already keeps it clean.

Preview and staging

Publish a staging version first, review it at a private URL, then promote it live. Your users see nothing until you promote.

publish dist as my-portfolio, but let me preview it before it goes live

The agent publishes with preview: true. You get back a private preview link shaped like https://<token>.preview.upubli.sh/. Share it with a reviewer, click through it yourself, confirm it looks right.

When you’re ready:

push the my-portfolio preview live

The site flips live instantly. The preview link stops working. If you decide you don’t want the staging version, publish again (either directly live or as a new preview) and the old staging version is replaced.

Preview publishing and promote are available on all plans. Version management (keeping, browsing, and rolling back to archived versions) requires a paid plan. See Managing Your Sites.

SPA routing

Single-page apps (React, Vue, Svelte, and friends) need one extra thing: paths that aren’t real files have to fall back to index.html, or a direct visit to you.upubli.sh/my-app/about/ 404s.

Your agent usually spots this from the build and turns it on. If it doesn’t, just say so:

that's a single-page app, turn on SPA routing

One catch: pass spa on every publish of the site, not just the first. A republish without it can switch SPA mode back off (it does when that same publish sets a passcode), and your deep links 404 again.

Plain static sites (hand-written HTML, no client-side router) don’t need it, and it’s off by default.

Slug rules

A slug is the URL-safe name you choose for a site. It names the site at a path — you.upubli.sh/slug/. Rules:

  • 1–255 characters
  • Lowercase letters and numbers only
  • Hyphens allowed in the middle (my-portfolio is fine, -portfolio is not)
  • Must start and end with a letter or number
  • Use _root to publish at the address root — you.upubli.sh/ instead of you.upubli.sh/slug/

Good slugs: my-portfolio, api-docs, v2, 1, demo2025

Avoid: anything with uppercase, anything starting or ending with a hyphen.

The slug stays stable across republishes. Changing a slug means publishing to a new slug. The old one continues to serve the previous version until you delete it.