Skip to content

Serverless

Serverless CI on GitHub Actions

Packaging bundles the whole node_modules tree for every function.

82 MB → 4 MB
Package size
6m → 90s
Deploy

Packaging bundles the whole node_modules tree for every function.

Why it happens

No bundler is configured, so deployment packages are large and slow to upload.

What to change

  1. Bundle with esbuild so packages are small and upload quickly
  2. Cache the plugin and dependency directories
  3. Deploy only changed functions rather than the entire stack

Serverless on runnerhut

yaml
jobs:
deploy:
runs-on: runnerhut-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npx serverless deploy --stage prod
A working starting point

The only runnerhut-specific line is `runs-on: runnerhut-4vcpu-ubuntu-2404`. Everything else is standard GitHub Actions — the same actions, the same secrets and the same permissions model you use today.

Your next build could be twice as fast, at half the price

Start free. Migrating away is the same one line, and we publish that diff too.