Skip to content

Instantly share code, notes, and snippets.

@Mallioch
Created May 6, 2021 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mallioch/804fd37b84c5074826cf6be7e6e2b814 to your computer and use it in GitHub Desktop.
Save Mallioch/804fd37b84c5074826cf6be7e6e2b814 to your computer and use it in GitHub Desktop.
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