Skip to main content

The Publish Script

publish.sh is a self-contained bash script that handles the entire publish flow: scanning files, computing hashes, uploading, and finalizing.

Download

Requirements

  • curl — for HTTP requests
  • jq — for JSON parsing
  • shasum or sha256sum — for file hashing (pre-installed on macOS and most Linux)

Usage

Publish a new site

Update an existing site

With authentication (permanent sites)

Custom API base URL

What the Script Does

1

Scan files

Recursively finds all files in the directory and builds a JSON manifest with relative paths, sizes, content types, and SHA-256 hashes.
2

Create or update

Sends the manifest to POST /api/v1/publish (new site) or PUT /api/v1/publish/:slug (update).
3

Upload files

Uploads each file to its presigned URL. Files that match by hash are skipped automatically.
4

Finalize

Calls the finalize endpoint to make the site live.

Output

Supported File Types

The script automatically detects content types for common file extensions:

CI/CD Integration

You can use the script in any CI/CD pipeline: