Specific branch context not running branch command


I’m trying to deploy a site on an specific branch named “preview” (https://preview-guidedogs-qa.netlify.app) with different context from the main site (https://guidedogs-qa.netlify.app). The code in the netlify.toml file is:

	functions = "functions"
	base = "/"
	command = "npm run build"

    package = "netlify-plugin-cache-nextjs"

	publish = "out/"
	command = "npm run export"

# Deploy Preview context: all deploys generated from
# a pull/merge request will inherit these settings.
#  command = "echo branch"

# Here is an example of how to define context-specific
# environment variables. To avoid committing sensitive
# values to public source repositories, set variables
# with the Netlify UI, CLI, or API instead.
#  command = "echo branch"

# Branch Deploy context: all deploys that are not from
# a pull/merge request or from the Production branch
# will inherit these settings.
#  command = "echo branch"
#  NODE_ENV = "development"

# Dev context: environment variables set here
# are available for local development environments
# run using Netlify Dev. These values can be
# overwritten on branches that have a more specific
# branch context configured.
  NODE_ENV = "development"

# Specific branch context: all deploys from
# this specific branch will inherit these settings.
	command = "npm run build"


	  package = "@netlify/plugin-nextjs"

Deploy details | Deploys | preview-guidedogs-qa | Netlify

I need the deployment for the preview branch to run the command “npm run build” but it’s always running “npm run export” that is the production context command.

Could you please point me to what I’m missing?
Thanks in advance


preview seems to be your production branch. Why not just specify the settings directly in build?