-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.web.yml
81 lines (67 loc) · 2.12 KB
/
azure-pipelines.web.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Node.js with React
# Build a Node.js project that uses React.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
variables:
# Azure Resource Manager connection created during pipeline creation
azureSubscription: '76722208-fb34-43c3-90f1-2a15d5616ce5'
# Working Directory
workingDirectory: '$(System.DefaultWorkingDirectory)/web'
storageAccount: mccachievementapi
stages:
- stage: Build
displayName: Build stage
jobs:
- job: Build
displayName: Build
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build
displayName: 'npm install and build'
workingDirectory: $(workingDirectory)
- publish: $(WorkingDirectory)/build
artifact: webapp
- stage: Deploy
displayName: Deploy stage
dependsOn: Build
condition: succeeded()
jobs:
- deployment: Deploy
displayName: Deploy
environment: 'development'
pool:
vmImage: 'vs2017-win2016'
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: webapp
# Azure file copy
# Copy files to Azure Blob Storage or virtual machines
- task: AzureFileCopy@3
inputs:
sourcePath: $(Pipeline.Workspace)/webapp
azureSubscription: $(azureSubscription)
destination: AzureBlob
storage: $(storageAccount)
containerName: $web
copyFilesInParallel: true
cleanTargetBeforeCopy: true
- task: PurgeAzureCDNEndpoint@2
inputs:
ConnectedServiceNameSelector: 'ConnectedServiceNameARM'
ConnectedServiceNameARM: 'Visual Studio Enterprise (533de7ba-f01c-404b-bd44-3812b36bb853)'
ResourceGroupName: 'MccAchievementApp'
EndpointName: 'mccachievementapp'
ProfileName: 'mccachievementapp-cdn'
PurgeContent: '/*'