2020-01-14 18:56:54 +08:00
|
|
|
name: Ant Design
|
2019-01-30 20:00:14 +08:00
|
|
|
|
2020-01-14 18:56:54 +08:00
|
|
|
trigger: none
|
|
|
|
|
|
|
|
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:
|
|
|
|
- stage: site
|
|
|
|
jobs:
|
|
|
|
- job: Build_Site
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
displayName: 'Checkout'
|
|
|
|
clean: true
|
|
|
|
fetchDepth: 1
|
|
|
|
- task: NodeTool@0
|
|
|
|
displayName: 'Install Node.js'
|
|
|
|
inputs:
|
|
|
|
versionSpec: '12.13.1'
|
|
|
|
- script: npm install
|
|
|
|
displayName: 'Install modules'
|
2020-01-14 22:43:06 +08:00
|
|
|
- script: |
|
|
|
|
node ./scripts/azure-github-comment.js '![Prepare preview](https://user-images.githubusercontent.com/5378891/72351368-2c979e00-371b-11ea-9652-eb4e825d745e.gif)'
|
|
|
|
displayName: 'Comment on github'
|
2020-01-14 18:56:54 +08:00
|
|
|
- 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
|
2020-01-14 22:43:06 +08:00
|
|
|
displayName: 'Deploy Site'
|
|
|
|
- script: |
|
|
|
|
node ./scripts/azure-github-comment.js "Preview deployed to https://preview-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-ant-design.surge.sh"
|
|
|
|
displayName: 'Update comment on github'
|