I'm trying to build and deploy ASP.NET Web application using GitHub actions and Azure.
I've successfully created and published to Azure a small app (.NET 4.8) using VS2017.
Now I'm trying to setup automatic deployment and I'm using the basic GitHub actions workflow that you get from Azure when setting up deployment.
When running the action I get into this error:
D:\a\pathtomyproject\myprojectname.csproj : error MSB4057: The target "pipelinePreDeployCopyAllFilesToOneFolder" does not exist in the project.
Here's the full action:
name: Build and deploy ASP app to Azure Web App
on:
push:
branches:
- develop
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: 'windows-latest'
steps:
- uses: actions/checkout@master
- name: Setup MSBuild path
uses: microsoft/[email protected]
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Restore NuGet packages
run: nuget restore
- name: Publish to folder
run: msbuild /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="\published\"
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: 'myname'
slot-name: 'production'
publish-profile: ${{ ... }}
package: \published\
Specifically, the error occurs during "Publish to folder" step.
/p:SkipInvalidConfigurations=true /p:DeployOnbuild=True /p:GenerateProjectSpecificOutputFolder=true /p:GenerateBuildInfoConfigFile=false /p:OutDir=$(Build.BinariesDirectory) /p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false /p:langversion=latest
That performs a file system publish to the $(Build.BinariesDirectory) directory (you'll want to replace that with whatever syntax GitHub Actions uses). – mason