Type something to search...

Astrolock deploy

astrolock deploy

astrolock deploy

Deploys your site to your configured hosting platform.

Usage

# Deploy to a target (dry run by default)
astrolock deploy <target>

# Execute deployment
astrolock deploy <target> --execute

# Skip build step
astrolock deploy <target> --skip-build --execute

Examples

# Deploy to live
astrolock deploy live --execute

# Deploy to stage (dry run first)
astrolock deploy stage
astrolock deploy stage --execute

# Deploy without rebuilding
astrolock deploy live --skip-build --execute

Info

By default, deploy runs a dry run showing what would happen. Add --execute to actually deploy.

Flags

FlagDescription
--skip-buildSkip building, deploy existing dist/
--executeActually deploy (default is dry-run)

Configuration

Configure targets in .astrolock/astrolock.yaml:

deploy:
  targets:
    stage:
      platform: aws
      url: https://stage.example.com
      aws:
        bucket: stage.example.com
        region: us-east-1
        cloudfront_distribution: EABC123STAGE

    live:
      platform: aws
      url: https://www.example.com
      aws:
        bucket: www.example.com
        region: us-east-1
        cloudfront_distribution: EXYZ789LIVE

Supported Platforms

PlatformConfiguration
AWS S3 + CloudFront"platform": "aws"
Netlify"platform": "netlify"
Vercel"platform": "vercel"

Workflow

First-time Setup

  1. Set up infrastructure - Follow the Terraform guide
  2. Configure deploy.json - Add targets with bucket, region, CloudFront
  3. Deploy - Run astrolock deploy <target> --execute

Daily Workflow

# Build and deploy to stage
astrolock deploy stage --execute

# Test on stage site...

# Deploy to live
astrolock deploy live --execute

Troubleshooting

Error: “No deployment targets configured”

Fix: Create .astrolock/astrolock.yaml with at least one target.

See Also

Tip

Always run astrolock preview to test your build before deploying to production.