forked from dddwa/dddperth-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vsts-ci.yml
83 lines (71 loc) · 2.36 KB
/
.vsts-ci.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
82
83
queue:
name: Hosted VS2017
demands:
- npm
- azureps
variables:
StorageAccount: 'dddperthdeployments'
StorageContainer: 'dddperth-website'
steps:
- task: DeleteFiles@1
inputs:
Contents: '.next/**/*.*'
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
displayName: Install Yarn
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@2
displayName: Install npm packages for app build (production)
inputs:
ProductionMode: true
- task: CopyFiles@2
displayName: Copy deployment packages to artifacts staging directory
inputs:
Contents: 'node_modules/**/*'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
CleanTargetFolder: true
OverWrite: true
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@2
displayName: Install npm packages for app build
- task: Npm@1
displayName: Lint
inputs:
command: custom
verbose: false
customCommand: 'run lint'
- task: Npm@1
displayName: Build
inputs:
command: custom
verbose: false
customCommand: 'run build'
- task: CopyFiles@2
displayName: Copy build files to artifacts staging directory
inputs:
Contents: |
.next/**/*
static/**/*
TargetFolder: '$(Build.ArtifactStagingDirectory)'
OverWrite: true
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: CopyFiles@2
displayName: Copy deploy files to artifacts staging directory
inputs:
SourceFolder: deploy
Contents: '**/*'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: ArchiveFiles@2
displayName: Archive files
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)'
includeRootFolder: false
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: AzureFileCopy@1
displayName: Copy deployment to blob storage
inputs:
SourcePath: '$(Build.ArtifactStagingDirectory)\$(Build.BuildNumber).zip'
azureSubscription: 'Microsoft Azure Sponsorship (dd079971-2023-4b56-be3a-85a346d51344)'
Destination: AzureBlob
storage: '$(StorageAccount)'
ContainerName: '$(StorageContainer)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))