pool:
  vmImage: 'ubuntu-latest' # other options: 'macOS-10.13', 'vs2017-win2016'

steps:

- task: UseDotNet@2
  displayName: 'Install .net core 3.0 (preview)'
  inputs:
    packageType: sdk
    version: '3.1.100'
    installationPath: $(Agent.ToolsDirectory)/dotnet

- script: dotnet restore Thornless.UI.Web/Thornless.UI.Web.csproj
  displayName: "Restore .Net dependencies"

- script: dotnet build Thornless.sln
  displayName: "Build"

- script: dotnet test Thornless.sln
  displayName: "Unit Tests"

- script: dotnet publish Thornless.UI.Web/Thornless.UI.Web.csproj --output $(Build.ArtifactStagingDirectory) --configuration Release
  displayName: "Publish"
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))

- task: CopyFilesOverSSH@0
  inputs:
    sshEndpoint: 'Hostwinds SSH'
    sourceFolder: '$(Build.ArtifactStagingDirectory)'
    contents: '**'
    targetFolder: '/var/www/thornless.weredev.com.new'
    cleanTargetFolder: true
    failOnEmptySource: true
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))

- task: SSH@0
  inputs:
    sshEndpoint: 'Hostwinds SSH'
    runOptions: 'commands'
    commands: 'cd /var/cicd && ./update-site.sh thornless.weredev.com'
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
Set up CI with Azure Pipelines
Set up CI with Azure Pipelines

[skip ci]