# run the same job on 2 CI machines in parallel
# https://docs.microsoft.com/en-us/vsts/pipelines/process/phases
phases:
  - phase: Test
    queue: 'Hosted Linux Preview'
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: '8.x'
        displayName: 'Install Node.js'

      # VSTS hosted Linux agents already have a LOT of dependencies preinstalled
      # https://github.com/Microsoft/vsts-agent-docker
      # so we don't have to install all recommended Cypress dependencies
      # https://on.cypress.io/continuous-integration#Dependencies
      - script: |
          apt-get update && apt-get install -y libgconf-2-4
        displayName: 'install dependencies'

      - script: |
          npm install -g yarn
        displayName: 'install yarn'

      - script: |
          cd client-react
          yarn install
        displayName: 'yarn install react app'

      - task: roshkovski.guid-generator.guid-generator.guid-generator@1
        displayName: GenerateHashSalt
        inputs:
          VariableName: REACT_APP_CACHE_KEY

      - script: |
          cd client-react
          yarn build
        displayName: 'create production build'

      - task: CopyFiles@2
        displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
        inputs:
          SourceFolder: client-react/build
          TargetFolder: '$(Build.ArtifactStagingDirectory)'

      - task: PublishBuildArtifacts@1
        displayName: 'Publish Artifact: dest'
        inputs:
          ArtifactName: dest

Add production build yaml for the react app
Add production build yaml for the react app
