Thanks for reaching out.
We actually have a KB article on handling reboots as part of your process here: How to Gracefully Handle a Reboot Step In Deploy Project
Can you please give that a read and test it in your environment and please let me know how it goes? Let me know if you have any questions.
Best,
Jeremy