Skip to content

Instantly share code, notes, and snippets.

@Tonel
Created September 15, 2022 14:49
Show Gist options
  • Save Tonel/ba4ba80273b57bb594f885b5dd2f1afc to your computer and use it in GitHub Desktop.
Save Tonel/ba4ba80273b57bb594f885b5dd2f1afc to your computer and use it in GitHub Desktop.
# removing the .env.local file because
# next uses it if it is present
rm -f ./.env.local
# if this is the staging deployment environment
if test "$ENV" = "staging"
then
# removing the .env.production file
# because otherwise next would use it
# as the default .env file
rm -f ./.env.production
# renaming ".env.staging" to ".env.production" so that
# next will use it as .env file
mv ./.env.staging ./.env.production
fi
# building the Next.js application
npm run next build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment