# Node.js with Angular
# Build a Node.js project that uses Angular.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript

trigger:
- main

pool: Default
#  vmImage: ubuntu-latest

steps:
- task: NodeTool@0
  inputs:
    versionSource: 'spec'
    versionSpec: '20.x'
  displayName: 'Install Node.js'

- script: |
    npm install -g @angular/cli
    npm install
    ng build 
  displayName: 'npm install and build'
- task: CopyFilesOverSSH@0
  inputs:
    sshEndpoint: 'NGWEB1'
    sourceFolder: './dist/thanksgiving'
    contents: '**'
    targetFolder: '/apps/tgd/front'
    cleanTargetFolder: true
    cleanHiddenFilesInTarget: true
    readyTimeout: '20000'

- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: 'dist'
    ArtifactName: 'drop'
    publishLocation: 'Container'
    StoreAsTar: true