pr: none
trigger: none

# Customize build number to include major version
# Example: fluentui_20190626.1
name: 'fluentui_$(Date:yyyyMMdd)$(Rev:.r)'

variables:
  - group: 'Github and NPM secrets'

pool: 'fluentbuild'

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

  - script: |
      git config user.name "Fluent UI Build"
      git config user.email "fluentui-internal@service.microsoft.com"
      git remote set-url origin https://$(githubUser):$(githubPAT)@github.com/microsoft/fluentui.git
    displayName: Authenticate git for pushes

  - script: |
      yarn
    displayName: yarn

  - script: |
      PRODUCTION=true yarn build
    displayName: yarn build

  - script: |
      NODE_ENV=production yarn build:fluentui:docs
    displayName: yarn build:fluentui:docs

  - task: AzureUpload@1
    displayName: Upload docs site
    inputs:
      SourcePath: 'packages/fluentui/docs/dist'
      azureSubscription: 'UI Fabric (private)'
      storage: fluentsite
      ContainerName: '$web'
      BlobPrefix: ''
# No NPM release in CI for now
#  - script: |
#      yarn test
#    displayName: yarn test
#
#  - script: |
#      yarn lint
#    displayName: yarn lint
#
#  - script: |
#      yarn release:fluentui:$(bumpType)
#    displayName: yarn release:fluentui:$(bumpType)
