Deployment
AkashJS provides zero-config deployment with akash deploy. It detects your target platform, generates the right configuration files, and deploys your app — all in a single command.
Zero-Config Deploy
akash deployThat is it. AkashJS inspects your project and automatically detects the right deployment target based on config files in your project (e.g., vercel.json, wrangler.toml, netlify.toml). If none are found, it defaults to a static export.
Auto-Detection
AkashJS looks for platform-specific files to determine where to deploy:
| File Detected | Platform |
|---|---|
vercel.json or .vercel/ | Vercel |
wrangler.toml | Cloudflare Pages/Workers |
netlify.toml or _redirects | Netlify |
deno.json | Deno Deploy |
| None of the above | Static export |
Explicit Target
Override auto-detection with the --target flag:
akash deploy --target vercel
akash deploy --target cloudflare
akash deploy --target netlify
akash deploy --target deno
akash deploy --target staticSSR Mode
Enable server-side rendering for your deployment:
akash deploy --ssrThis generates a server entry point alongside your client bundle. Each platform adapter handles SSR differently:
- Vercel — Generates a serverless function in
api/ - Cloudflare — Generates a Workers script with
fetchhandler - Netlify — Generates a Netlify Function in
netlify/functions/ - Deno — Generates a
main.tsentry for Deno Deploy
Without --ssr, the app is built as a fully static SPA.
Dry Run
Preview what will happen without actually deploying:
akash deploy --dry-runOutput:
Detected target: cloudflare
Mode: SSR
Build output: dist/
Files to upload: 42 (1.2 MB)
Generated files:
wrangler.toml (updated)
dist/_worker.js
dist/assets/ (38 files)
No changes deployed (dry run).This is useful for CI pipelines where you want to verify the build before deploying.
Platform Adapters
Each deployment target has a platform adapter that generates the necessary config and entry files.
Vercel
akash deploy --target vercelGenerates:
vercel.json # build and route configuration
api/ssr.ts # serverless function for SSR (if --ssr)
dist/ # static assetsThe generated vercel.json:
{
"buildCommand": "akash build",
"outputDirectory": "dist",
"framework": null,
"routes": [
{ "src": "/assets/(.*)", "dest": "/assets/$1" },
{ "src": "/(.*)", "dest": "/api/ssr" }
]
}Cloudflare
akash deploy --target cloudflareGenerates:
wrangler.toml # Workers/Pages configuration
dist/_worker.js # Worker entry point (if --ssr)
dist/ # static assetsNetlify
akash deploy --target netlifyGenerates:
netlify.toml # build and redirect configuration
netlify/functions/ssr.ts # serverless function (if --ssr)
dist/ # static assets
_redirects # SPA fallback routingDeno Deploy
akash deploy --target denoGenerates:
deno.json # Deno configuration
main.ts # entry point for Deno Deploy
dist/ # static assetsStatic Export
For a plain static site with no server requirements:
akash deploy --target staticThis produces a dist/ directory with all HTML, CSS, JS, and assets. Upload it anywhere — any static file host, S3 bucket, GitHub Pages, or your own nginx server.
dist/
index.html
assets/
app-[hash].js
app-[hash].css
...Build Options
Combine flags to control the build:
# Production build with SSR for Cloudflare
akash deploy --target cloudflare --ssr
# Static build, custom output directory
akash deploy --target static --outDir build
# Preview locally before deploying
akash build --previewCI/CD Example
Deploy from GitHub Actions:
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npx akash deploy --target vercel
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}Environment Variables
Set environment variables for your deployment:
akash deploy --env API_URL=https://api.example.com --env DEBUG=falseOr use a .env.production file — AkashJS reads it automatically during build:
# .env.production
API_URL=https://api.example.com
PUBLIC_ANALYTICS_ID=UA-123456Variables prefixed with PUBLIC_ are available in client-side code via import.meta.env.PUBLIC_ANALYTICS_ID. All other variables are server-only.