Essentially you just need to:
- Build the correct directory structure within a subdirectory (e.g ./package/usr/bin for binaries, ./package/usr/share for docs, etc). This needs to include a few Debian-specific files, like a control file that contains metadata for the package, a copyright file, install and uninstall scripts if needed, etc.
- Use
dpkg-debto package the files into a .deb file. - Run
lintianto check that there's no issues with the package.
There's probably newer tools, but these are the core ones that have been part of Debian forever (and thus are very well-documented online).
You can then use Aptly to create a custom repo, or deb-get to install packages from Github releases.
I worked on the Debian packaging for Yarn v1. You can see the script that creates deb and rpm packages here: https://github.com/yarnpkg/yarn/blob/master/scripts/build-deb.sh (this uses fpm to build the rpm package, and the native Debian tools to build the deb package)
One thing I don't have experience with is submitting packages to the official Debian repo, so I can't help with that.