This article offers a step-by-step guide to deploy a .NET Core Worker Service into a linux systemd service unit/daemon. Thanks to the author I successfully achieved the desired result.
There is one thing, however, I am finding counter-intuitive in the whole process: to have these pre-make build cleanup steps - before creating the .tar file - when eventually the rules makefile will define the publish (and implicitly a build) command in build override target.
I assume dh_make works on a tar and that's why we create it before the publish, but would not the cleanup steps fit better if put after the publish execution ?
Could anyone clarify that?