Normally, you should not use sudo for all of your commands. That is really specific and hard to answer without more information.
Your second question is easier to answer: Add the --force flag.
php artisan migrate --force. No questions will be asked, which is good for any kind of CI/CD.
https://laravel.com/docs/9.x/migrations#forcing-migrations-to-run-in-production