Skip to content

Deploy to Netlify

ACMS works with Netlify for both static sites and serverless applications. This guide covers deploying your ACMS-powered application to Netlify.

  • A Netlify account
  • Your application working locally with acms dev
  • A production storage adapter configured in acms.config.ts
acms.config.ts
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',
});

Upload your local content to the production adapter:

Terminal window
acms push

In the Netlify dashboard under Site Settings > Environment Variables, add:

  • GITHUB_TOKEN
  • GITHUB_GIST_ID

Or whatever credentials your chosen adapter requires.

In netlify.toml:

[build]
command = "npm run build"
publish = "dist" # Adjust for your framework
[build.environment]
NODE_VERSION = "20"
Terminal window
netlify deploy --prod

Or connect your Git repository for automatic deployments.

  1. Edit content locally or via the dashboard.
  2. Run acms push to upload to the production adapter.
  3. Trigger a Netlify rebuild via the dashboard, CLI, or build webhook.
  4. New content is live.

Create a build webhook in Netlify (Site Settings > Build & deploy > Build hooks) and trigger it after pushing content:

Terminal window
acms push && curl -X POST https://api.netlify.com/build_hooks/your-hook-id
[build]
command = "next build"
publish = ".next"

Install the Netlify Next.js plugin for full Next.js support.

[build]
command = "astro build"
publish = "dist"
[build]
command = "vite build"
publish = "build"

Use the @sveltejs/adapter-netlify adapter.