My original question was about a deployment issue not showing wwwroot folder on the remote server. It turned out, I was wrong and that wasn't actually the issue. So I've edited my question (and the first few comments are not relevant now)!!
I'm trying to publish my website from GitHub to my server, via GitHub actions
- name: Stop Application Pool
shell: cmd
run: '"C:/Program Files (x86)/IIS/Microsoft Web Deploy V3/msdeploy.exe" -verb:sync -allowUntrusted -source:recycleApp -dest:recycleApp="${{ env.IIS_WEBSITE_NAME }}",recycleMode="StopAppPool",computerName="${{ env.DOMAIN_URL }}:8172/msdeploy.axd?site=${{ env.IIS_WEBSITE_NAME }}",username="${{ env.IIS_SERVER_USERNAME }}",password="${{ env.IIS_SERVER_PASSWORD }}",AuthType="Basic"'
- name: Deploy Application to Live
shell: cmd
run: '"C:/Program Files (x86)/IIS/Microsoft Web Deploy V3/msdeploy.exe" -verb:sync -allowUntrusted -source:contentPath="%cd%\${{ env.PUBLISH_PATH }}" -dest:contentPath="${{env.IIS_WEBSITE_NAME}}",computerName="${{ env.DOMAIN_URL }}:8172/msdeploy.axd?site=${{ env.IIS_WEBSITE_NAME }}",username="${{ env.IIS_SERVER_USERNAME }}",password="${{ env.IIS_SERVER_PASSWORD }}",authtype="Basic"'
- name: Start Application Pool
shell: cmd
run: '"C:/Program Files (x86)/IIS/Microsoft Web Deploy V3/msdeploy.exe" -verb:sync -allowUntrusted -source:recycleApp -dest:recycleApp="${{ env.IIS_WEBSITE_NAME }}",recycleMode="StartAppPool",computerName="${{ env.DOMAIN_URL }}:8172/msdeploy.axd?site=${{ env.IIS_WEBSITE_NAME }}",username="${{ env.IIS_SERVER_USERNAME }}",password="${{ env.IIS_SERVER_PASSWORD }}",AuthType="Basic"'
The above is the code within GitHub actions. This stops the application pool on the server, deploys the site, and starts the application pool
This works for the most part (no exceptions or error messages in GitHub actions) but when I visit my result, I always see
The website publishes fine with a working website if i use WebDeploy in Visual Studio
I have researched and it seems like I need to set "remove additional files at destination" is also required, but, I can't see the command line argument for msdeploy to do this. However, as I'm using the verb sync I thought it would do that automatically.
Having written that, I do believe something strange is going on with left over files. If I manually delete the entire directory on my web server, and use the command lines above, the website publishes and works as expected. The issue only occurs if there are already files when I try to run the code above
I have no idea what I'm doing wrong.

