-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.yml
56 lines (49 loc) · 1.38 KB
/
azure-pipelines.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
trigger:
- main
- development
pool:
vmImage: 'ubuntu-latest'
variables:
- group: 'ftp-variables'
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
command: 'install'
- task: Npm@1
displayName: 'npm run build'
inputs:
command: 'custom'
customCommand: 'run build'
- task: CopyFiles@2
displayName: 'Copy files to artifact staging'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
SourceFolder: 'build'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
CleanTargetFolder: true
OverWrite: true
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts to Azure Pipelines'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'website'
publishLocation: 'Container'
- task: FtpUpload@1
displayName: 'Deploy website via FTP'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
credentialsOption: 'inputs'
serverUrl: '$(ftp.server)'
username: '$(ftp.username)'
password: '$(ftp.password)'
rootDirectory: '$(Build.ArtifactStagingDirectory)'
filePatterns: '**'
remoteDirectory: 'unitydevops.com'
clean: true
cleanContents: false
overwrite: true
preservePaths: true
trustSSL: true