2020-01-14 18:56:54 +08:00
|
|
|
name: Ant Design
|
2019-01-30 20:00:14 +08:00
|
|
|
|
2020-10-30 15:29:23 +08:00
|
|
|
trigger: none
|
2020-10-28 11:47:38 +08:00
|
|
|
|
2020-01-14 18:56:54 +08:00
|
|
|
pr:
|
|
|
|
autoCancel: true
|
2019-02-01 14:55:50 +08:00
|
|
|
branches:
|
|
|
|
exclude:
|
|
|
|
- gh-pages
|
2019-01-30 20:00:14 +08:00
|
|
|
|
2020-01-14 18:56:54 +08:00
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
|
|
|
stages:
|
2020-05-25 17:40:57 +08:00
|
|
|
- stage: site
|
2020-10-27 14:14:34 +08:00
|
|
|
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
|
2020-05-25 17:40:57 +08:00
|
|
|
jobs:
|
|
|
|
- job: Build_Site
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
displayName: 'Checkout'
|
|
|
|
clean: true
|
|
|
|
fetchDepth: 1
|
|
|
|
- task: NodeTool@0
|
|
|
|
displayName: 'Install Node.js'
|
|
|
|
inputs:
|
2020-08-17 19:32:03 +08:00
|
|
|
versionSpec: '14.7.0'
|
2020-05-25 17:40:57 +08:00
|
|
|
- script: npm install
|
|
|
|
displayName: 'Install modules'
|
|
|
|
- script: |
|
|
|
|
node ./scripts/azure-github-comment.js "[![Prepare preview](https://user-images.githubusercontent.com/5378891/72351368-2c979e00-371b-11ea-9652-eb4e825d745e.gif)](https://dev.azure.com/ant-design/ant-design/_build/results?buildId=$(Build.BuildId))"
|
|
|
|
displayName: 'Comment on github'
|
|
|
|
- script: npm run site
|
|
|
|
displayName: 'Build sites'
|
|
|
|
- script: ls -al _site/
|
|
|
|
displayName: 'List build'
|
|
|
|
- script: |
|
|
|
|
export DEPLOY_DOMAIN=https://preview-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-ant-design.surge.sh
|
|
|
|
echo "Deploy to $DEPLOY_DOMAIN"
|
|
|
|
npx surge --project ./_site --domain $DEPLOY_DOMAIN
|
|
|
|
displayName: 'Deploy Site'
|
|
|
|
- script: |
|
|
|
|
export DEPLOY_DOMAIN=https://preview-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-ant-design.surge.sh
|
|
|
|
node ./scripts/azure-github-comment.js "[<img width="306" src="https://user-images.githubusercontent.com/5378891/72400743-23dbb200-3785-11ea-9d13-1a2d92743846.png">]($DEPLOY_DOMAIN)"
|
|
|
|
displayName: 'Update comment on github'
|
|
|
|
- job: Build_Site_Failed
|
|
|
|
dependsOn: Build_Site
|
|
|
|
condition: failed()
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
displayName: 'Checkout'
|
|
|
|
clean: true
|
|
|
|
fetchDepth: 1
|
|
|
|
- task: NodeTool@0
|
|
|
|
displayName: 'Install Node.js'
|
|
|
|
inputs:
|
2020-08-17 19:32:03 +08:00
|
|
|
versionSpec: '14.7.0'
|
2020-05-25 17:40:57 +08:00
|
|
|
- script: npm install
|
|
|
|
displayName: 'Install modules'
|
|
|
|
- script: |
|
|
|
|
node ./scripts/azure-github-comment.js "[<img width="534" src="https://user-images.githubusercontent.com/5378891/75333447-1e63a280-58c1-11ea-975d-235367fd1522.png">](https://dev.azure.com/ant-design/ant-design/_build/results?buildId=$(Build.BuildId))"
|
|
|
|
displayName: 'Comment on github'
|