Type something to search...

Step 3: Deployment

Deploy your Astrolock site to AWS, Netlify, or Vercel

Tip

Prerequisites: Complete Step 1 and Step 2 first. This guide assumes you have a working site ready to publish.

What You’ll Learn

By the end of this guide, you’ll understand:

  • ✅ What deployment targets are
  • ✅ How to configure a deployment target
  • ✅ How to deploy your site
  • ✅ Managing multiple environments (staging, production)

Time Required: 15-20 minutes (first time), 2 minutes (subsequent deployments)


Understanding Deployment

Astrolock deployment is a two-step process:

  1. Build - Generate static HTML/CSS/JS files in dist/
  2. Upload - Push those files to your hosting platform
astrolock deploy [target] --execute

This single command:

  • Builds your site for the target’s URL
  • Uploads everything to the hosting platform
  • Invalidates CDN cache (if configured)

Prerequisites

Before you can deploy, you need:

1. A Deployment Target Configured

Your .astrolock/astrolock.yaml file must have a deploy section. This is typically set up by your developer.

deploy:
  default: "production"
  targets:
    production:
      url: "https://www.example.com"
      platform: "aws"
      aws:
        bucket: "www.example.com"
        region: "us-east-1"
        cloudfront_distribution: "E123456789"

If you don’t have this configured yet, see Add a Deployment Target below.

2. Platform Access

Depending on your platform, you’ll need:

AWS CLI configured with credentials:

# Verify AWS CLI is installed
aws --version

# Check your configured profile
aws configure list --profile your-site-name

Your developer should provide:

  • AWS profile name (matches bucket name)
  • Instructions to configure credentials

Add a Deployment Target

If you don’t have a deployment target configured yet, use the wizard:

astrolock deploy add

The wizard will guide you through:

Target name (e.g., 'live', 'staging'): production

Deployment platform:
  1) AWS (S3 + CloudFront)
  2) Netlify
  3) Vercel

Choose platform (1-3): 1

Site URL (e.g., https://example.com): https://www.yoursite.com

AWS Configuration:
S3 bucket name: www.yoursite.com
AWS region [us-east-1]: us-east-1
CloudFront distribution ID (optional): E123456789

✓ Deployment target 'production' added successfully!

Make this the default deployment target? [y/N]: y

After adding a target, you can deploy immediately.


Deploying Your Site

First Deployment (Dry Run)

Always test with a dry run first:

astrolock deploy production

This shows you exactly what would happen without actually deploying. Review the output carefully.

Building site for https://www.yoursite.com...
✓ Build complete: dist/

Deployment Plan (DRY RUN):
  Platform: AWS S3
  Bucket:   www.yoursite.com
  Region:   us-east-1

Files to upload: 127
  - index.html
  - blog/index.html
  - images/...
  - css/...

CloudFront invalidation:
  Distribution: E123456789
  Paths: /*

⚠️  DRY RUN ONLY - No changes made

To execute deployment, add --execute flag:
  astrolock deploy production --execute

Execute Deployment

Once you’ve reviewed the dry run, deploy for real:

astrolock deploy production --execute

Warning

The --execute flag is required to actually deploy. This prevents accidental deployments.

Using Default Target

If you set a default target in .astrolock/astrolock.yaml:

deploy:
  default: "production"

You can deploy without specifying the target:

astrolock deploy --execute

Managing Multiple Environments

It’s common to have staging and production environments:

deploy:
  default: "production"
  targets:
    staging:
      url: "https://staging.yoursite.com"
      platform: "aws"
      aws:
        bucket: "staging.yoursite.com"
        region: "us-east-1"

    production:
      url: "https://www.yoursite.com"
      platform: "aws"
      aws:
        bucket: "www.yoursite.com"
        region: "us-east-1"
        cloudfront_distribution: "E123456789"

Typical Workflow

  1. Test locally:

    astrolock write
  2. Deploy to staging:

    astrolock deploy staging --execute
  3. Review staging site at https://staging.yoursite.com

  4. Deploy to production:

    astrolock deploy production --execute

Advanced Options

Skip Build Step

If you’ve already built your site and just want to re-upload:

astrolock deploy production --skip-build --execute

Info

Use this when you need to re-deploy the exact same build (e.g., after a failed upload).

Build for Specific Target

Build without deploying:

astrolock build --target production

This builds with the production URL as the base_url.


Troubleshooting

You don’t have a deployment target configured.

Fix:

astrolock deploy add

Follow the wizard to add your first target.

Your AWS CLI isn’t configured for the required profile.

Fix:

# Configure AWS profile
aws configure --profile your-bucket-name

# Test access
aws s3 ls --profile your-bucket-name

Contact your developer for the access key and secret.

For AWS with CloudFront:

CloudFront caching may be delaying updates. The deploy command invalidates the cache, but it can take 5-10 minutes.

Force refresh:

  • Clear your browser cache (Cmd+Shift+R / Ctrl+Shift+R)
  • Use incognito/private browsing mode
  • Wait a few minutes for CloudFront invalidation to complete

Check that:

  1. All content files have valid frontmatter
  2. No missing images or media files
  3. Run astrolock build --target production to test the production build locally

What Your Developer Provides

When setting up deployment, your developer should give you:

  • AWS Profile Name (usually matches bucket name)
  • Access Key ID and Secret Access Key
  • Bucket Name
  • Region
  • CloudFront Distribution ID (if using CDN)
  • Instructions to run: aws configure --profile [profile-name]
  • Site ID
  • Instructions to run: netlify login
  • Any required environment variables
  • Project Name
  • Instructions to run: vercel login
  • Any required environment variables

Your developer may also set up the entire deploy configuration in .astrolock/astrolock.yaml for you.


Next Steps

Tip

Congratulations! You can now deploy your Astrolock site to production.

Continue Learning

Import Tools → Learn how to bulk import existing content:

  • DJ mixes from Rekordbox
  • Photos from Apple Photos or Lightroom
  • Media files from directories

CLI Reference → Full documentation for all commands:

  • astrolock deploy options
  • astrolock build configurations
  • All available CLI commands

Astrolock Documentation → For advanced deployment architecture and CI/CD setup

Common Commands

Dry run deployment:

astrolock deploy production

Execute deployment:

astrolock deploy production --execute

Deploy to default target:

astrolock deploy --execute

Add new target:

astrolock deploy add

Build for specific target:

astrolock build --target production

Deploy without rebuilding:

astrolock deploy production --skip-build --execute