Deploy to Vercel
Vercel is a natural fit for ACMS-powered applications, especially those built with Next.js. This guide covers deploying your application and connecting it to a production storage adapter.
Prerequisites
Section titled “Prerequisites”- A Vercel account
- Your application working locally with
acms dev - A production storage adapter configured in
acms.config.ts
Build-Time Strategy
Section titled “Build-Time Strategy”For static or ISR sites, use the build-time strategy. Content is fetched during vercel build and baked into the output.
1. Configure the Production Adapter
Section titled “1. Configure the Production Adapter”import { defineConfig } from '@useacms/client';import { localFile, githubGist } from '@useacms/cli/adapters';
export default defineConfig({ dev: localFile({ path: './acms.json' }), production: githubGist({ token: process.env.GITHUB_TOKEN, gistId: process.env.GITHUB_GIST_ID, }), strategy: 'build-time',});2. Push Content to Production
Section titled “2. Push Content to Production”Before deploying, push your local content to the production adapter:
acms push3. Set Environment Variables
Section titled “3. Set Environment Variables”In the Vercel dashboard, add your adapter credentials as environment variables:
GITHUB_TOKEN— Your GitHub personal access tokenGITHUB_GIST_ID— Your Gist ID
4. Deploy
Section titled “4. Deploy”vercel deployOr connect your Git repository for automatic deployments.
Runtime Strategy with Edge Config
Section titled “Runtime Strategy with Edge Config”For dynamic content that updates without rebuilds, use the runtime strategy with Vercel Edge Config:
import { defineConfig } from '@useacms/client';import { localFile, vercelEdgeConfig } from '@useacms/cli/adapters';
export default defineConfig({ dev: localFile({ path: './acms.json' }), production: vercelEdgeConfig({ token: process.env.VERCEL_TOKEN, edgeConfigId: process.env.EDGE_CONFIG_ID, }), strategy: 'runtime',});With this setup, content changes are available immediately after acms push without redeploying.
Content Update Workflow
Section titled “Content Update Workflow”Build-Time
Section titled “Build-Time”- Edit content locally or via the dashboard.
- Run
acms pushto upload to the production adapter. - Trigger a Vercel rebuild (manually or via webhook).
- New content is live.
Runtime
Section titled “Runtime”- Edit content locally or via the dashboard.
- Run
acms pushto upload to Edge Config. - Content is live immediately (no rebuild needed).
Vercel Build Configuration
Section titled “Vercel Build Configuration”If your project uses ACMS with Next.js, no special build configuration is needed. The standard next build works:
{ "buildCommand": "next build", "outputDirectory": ".next"}For other frameworks:
{ "buildCommand": "astro build", "outputDirectory": "dist"}Next Steps
Section titled “Next Steps”- Learn about Vercel Edge Config adapter details
- Explore the Hosted SaaS platform for managed content