Deploying on DigitalOcean
DigitalOcean App Platform works out of the box with BCMS projects. You just need to set the right environment variables.
Set environment variables
In the App Platform dashboard, go to your app settings and add the following environment variables:
NEXT_PUBLIC_BCMS_ORG_ID
NEXT_PUBLIC_BCMS_INSTANCE_ID
NEXT_PUBLIC_BCMS_API_KEY_ID
NEXT_PUBLIC_BCMS_API_KEY_SECRET
Use the same values as in your local .env
file.
Reference them in code
Initialize the BCMS client using these variables:
import { Client } from '@thebcms/client'; export const bcms = new Client( process.env.NEXT_PUBLIC_BCMS_ORG_ID, process.env.NEXT_PUBLIC_BCMS_INSTANCE_ID, { id: process.env.NEXT_PUBLIC_BCMS_API_KEY_ID, secret: process.env.NEXT_PUBLIC_BCMS_API_KEY_SECRET, } );
Static and dynamic content
If your project uses static builds, App Platform will re-deploy only when you manually trigger a build or push to Git.