-
-
Save mfakhrys/677b0b64e3d82d35145a396ade0c9c3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#zero downtime deployment nextjs without vercel | |
echo "Deploy starting..." | |
git pull | |
npm install || exit | |
BUILD_DIR=temp npm run build || exit | |
if [ ! -d "temp" ]; then | |
echo '\033[31m temp Directory not exists!\033[0m' | |
exit 1; | |
fi | |
rm -rf .next | |
mv temp .next | |
pm2 reload app --update-env | |
echo "Deploy done." | |
#make sure `next.config.js` it set `distDir: process.env.BUILD_DIR` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment