Overview
The sunpeak deploy command is a convenience wrapper around sunpeak push that automatically applies the prod tag to your resources. This is the recommended way to deploy to production.
sunpeak deploy [file] [options]
sunpeak deploy is equivalent to sunpeak push --tag prod
You must be logged in to use this command. Run sunpeak login first.
Prerequisites
Before deploying:
- Login - Run
sunpeak login to authenticate
- Build - Run
sunpeak build to create production bundles
How It Works
The deploy command:
- Finds all built resources in
dist/
- Uploads each resource to the Sunpeak repository
- Assigns the
prod tag (or a custom tag if specified)
$ sunpeak deploy
Deploying to production...
Pushing 2 resource(s) to repository "myorg/my-app"...
Tag: prod
✓ Pushed search (id: abc123)
Tags: prod
✓ Pushed dashboard (id: def456)
Tags: prod
✓ Successfully pushed 2 resource(s).
Arguments
| Argument | Description |
|---|
file | Optional JS file to deploy (e.g., dist/carousel.js). If not provided, deploys all resources from dist/ |
Options
| Option | Short | Description |
|---|
--repository <owner/repo> | -r | Repository name (defaults to git remote origin) |
--tag <name> | -t | Override the tag (defaults to prod) |
--help | -h | Show help message |
Usage Examples
Deploy All Resources
Deploy a Single Resource
sunpeak deploy dist/carousel.js
Deploy with Custom Tag
If you need a different production tag:
sunpeak deploy --tag production
Deploy to Specific Repository
sunpeak deploy --repository myorg/my-app
Typical Workflow
A standard deployment workflow:
# 1. Build production bundles
sunpeak build
# 2. Deploy to production
sunpeak deploy
Or as a single command:
sunpeak build && sunpeak deploy
Add this to your package.json scripts for convenience:{
"scripts": {
"release": "sunpeak build && sunpeak deploy"
}
}
Deploy vs Push
| Command | Default Tag | Use Case |
|---|
sunpeak deploy | prod | Production deployments |
sunpeak push | None | Staging, versioning, or custom workflows |
Use sunpeak deploy when you want to deploy to production with a simple command. Use sunpeak push when you need more control over tagging or want to push to non-production environments.