A deploy script that runs restart will also start a service you stopped on purpose. There is a verb that leaves stopped things alone.
sudo systemctl try-restart nginx.service
The man page describes it as stopping and then starting the units if they are running. When the service is not running, nothing happens and the command still succeeds.
That behaviour suits maintenance scripts. After renewing a certificate or updating a library, restart whatever uses it, and skip what is switched off on this particular machine:
sudo systemctl try-restart nginx.service postfix.service dovecot.service
I like it on a fleet where not every host runs every service, because the same script can go everywhere without a pile of if statements.
The flip side is that it will not help you when the service has crashed. A failed unit is not running, so try-restart skips it and your script reports success. If the goal is a running service afterwards, use restart and check the result with is-active. Also note that a restart drops open connections, even when only the certificate changed, so a reload can be kinder when the program supports it.
Further reading: systemctl man page