Show HN: One-command static site deployments to Bunny.net

bcye1 pts0 comments

bruceroettgers.eu/bunnyup at main · Tangled

bruceroettgers.eu

bunnyup

Star

Fork

Atom

Configure Feed

Issues

Pull Requests

Commits

Tags

Feed URL

Select the types of activity you want to include in your feed.

Deploy static websites to Bunny.net with a single command

Star

Fork

Atom

Configure Feed

Issues

Pull Requests

Commits

Tags

Feed URL

Select the types of activity you want to include in your feed.

TypeScript

100.0%

Other

0.1%

main

v0.3.0

v0.2.0

v0.1.0

41

Code

Clone this repository

Use permalink

HTTPS

https://tangled.org/bruceroettgers.eu/bunnyup<br>https://tangled.org/did:plc:hwushzgfgxojcjhygmmzhr4g<br>getComputedStyle(s).display !== 'none').textContent)"<br>class="px-3 py-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"<br>title="Copy to clipboard"

SSH

git@tangled.org:bruceroettgers.eu/bunnyup<br>git@tangled.org:did:plc:hwushzgfgxojcjhygmmzhr4g<br>getComputedStyle(s).display !== 'none').textContent)"<br>class="px-3 py-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"<br>title="Copy to clipboard"

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz

Download .zip

examples

2 months ago

src

17 minutes ago

tests

1 month ago

.gitignore

5 months ago

.prettierrc

2 months ago

CLAUDE.md

1 month ago

CONTRIBUTING.md

1 month ago

LICENSE.txt

2 months ago

README.md

9 minutes ago

bun.lock

2 months ago

package.json

17 minutes ago

tsconfig.json

5 months ago

Commits<br>41

improve README.md

941ef923

Bruce Röttgers

9 minutes ago

main

v0.3 - more sensible default caching

f9443a33

Bruce Röttgers

12 minutes ago

Merge branch 'main' of github.com:bcye/bunnyup

b1caa83a

Bruce Röttgers

1 month ago

improve messaging

85b7310d

Bruce Röttgers

1 month ago

Branches

main

9 minutes ago

Default

Tags

v0.3.0

16 minutes ago

Latest

README.md

bunnyup#

CLI tool for deploying static sites to Bunny.net. Go from zero to your site deployed across the globe in under a minute.

Supports one-command rollbacks (Deployments are identified by their git hash)

Sensible caching out of the box

Deploy on push via the provided GitHub Actions example

Note: Still in beta, I'm testing it on my own projects. Further configuration of CDN & Caching settings may still be required depending on your project. This project is not affiliated with bunny.net.

Installation#

Requires the Bun runtime installed. Installing & running using npm, pnpm, etc. will fail!

bun add -g bunnyup<br>Quick Start#

# 1. Authenticate<br>bn login

# 2. Set up your project<br>bn new

# 3. Commit Files (bn new creates a config file, bn deploy expects a clean repository)<br>git add . && git commit -m "setup bunnyup"

# 4. Build and deploy<br>npm run build && bn deploy<br>Why#

I wanted Vercel-like static site deployments with EU-based hosting.

Bunny.net has the infrastructure for great static site hosting, but no good way to iteratively ship to it. This CLI is the missing piece.

Concept#

Bunnyup simplifies the deployment of statically built sites to bunny.net. It follows the following deployment process:

Upload files to a new storage zone (i.e. bucket), identified by the git commit hash.

Activate that deployment by pointing the pull zone (i.e. CDN configuration) at the new storage zone

Prune deployments older than x days

Old deployments remain available until pruned and can be rolled back to at any time via bn activate.

The Pull Zone the CLI creates is long-lived and may be reconfigured afterwards as needed.

You may want to visit the Bunny.net dashboard after running bn new to make any applicable adjustments for your setup.

Caching#

Caching is configured by default, oriented around framework-built static sites, with the following settings. CDN Cache is not purged in between deployments. Uncached content is served from the 15 edge storage regions.

CDN Cache<br>Browser Cache<br>Assets

not cached<br>not cached<br>html, json, xml

3 hours<br>public, max-age=31536000, immutable<br>Framework assets (_next, _astro, _nuxt, _app/immutable)

3 hours<br>3 hours<br>All other assets

Commands#

Command<br>Description

bn login<br>Save your Bunny.net API key (this is stored securely in your OS Keychain via Bun.secrets)

bn new<br>Configure a new site

bn deploy<br>Upload → activate → prune

bn upload<br>Upload files to a new version

bn activate [version]<br>Switch to a git ref/hash (default: HEAD)

bn prune<br>Delete old deployments

bn cleanup<br>Delete the pull zone and all storage zones for this project on Bunny.net

Options#

--no-prune - Skip pruning old versions (deploy)

-f, --force - Upload with uncommitted git changes (upload, deploy)

-y, --yes - Skip confirmation prompts (prune, cleanup)

Requires clean git working directory by default. Use --force to override.

Configuration#

bn new creates a bunnyup.json file:

"name": "my-site",<br>"outputFolder": "dist",<br>"pruneAfter": "30",<br>"pullZoneId": 123456

pruneAfter is the number of days after which old deployments will be deleted by bn...

bunnyup bunny deployments deploy text gray

Related Articles