Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save davidisnotnull/5feea98be8ebe31b3be924ae098472f9 to your computer and use it in GitHub Desktop.
Save davidisnotnull/5feea98be8ebe31b3be924ae098472f9 to your computer and use it in GitHub Desktop.
pool:
name: Self Hosted
demands: npm
variables:
solution: '**/*.sln'
buildConfiguration: 'Release'
steps:
- task: DotNetCoreCLI@2
displayName: 'Restore Packages'
inputs:
command: restore
projects: '**/*.csproj'
- task: DeleteFiles@1
displayName: 'Clean Front End files'
inputs:
SourceFolder: src/Solution/WebProject/wwwroot
Contents: '/dist/*'
- task: Npm@1
displayName: 'npm install'
inputs:
command: ci
workingDir: src/Solution/WebProject/Content
verbose: false
- task: Npm@1
displayName: 'npm run build'
inputs:
command: custom
workingDir: src/Solution/WebProject/Content
verbose: false
customCommand: 'run build'
- task: DotNetCoreCLI@2
displayName: 'Build and Publish'
inputs:
command: publish
publishWebProjects: True
arguments: '--configuration $(buildConfiguration) /p:environmentName=$(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: True
- task: PublishBuildArtifacts@1
displayName: 'Copy Publish Artifacts'
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'myWebApp'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment