I know this is unbelievely basic but to publish the currently selected file in Visual Studio 2017 whether it’s the current file you’re working on or one you have selected in the solution explorer all you have to do it press the following…
Hold Alt, then press ; then press P
The reason for this post is that Visual Studio displays the shortcut key as Alt+;,Alt+P which I found a bit confusing and after a bit of ‘googling’ I found that many others out there thought the same too!