Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
trigger:
- main
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 5.0.201
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: restore
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: 'build'
projects: '**/*.sln'
# Testing
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: 'test'
projects: '**/*tests.csproj'
arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
testRunTitle: 'Generic Repository Tests'
# Publishing
- script: dotnet publish -c Release -o build /p:PackageAsSingleFile=true
displayName: Publish
- script: tar -a -c -C build -f Application.zip *.*
displayName: Zip
- task: AzureWebApp@1
displayName: 'Deploy Azure Web App'
inputs:
azureSubscription: DogMoneyAzureConnection
appName: dogmoney
appType: webApp
package: ./**/*.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment