-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
75 lines (72 loc) · 1.79 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
75 lines (72 loc) · 1.79 KB
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
# PHP
trigger:
branches:
include:
- trunk
- release-v1
paths:
exclude:
- azure-pipelines.yml
pr:
branches:
include:
- trunk
- release-v*
- hotfix-v*
pool:
vmImage: ubuntu-latest
variables:
phpVersion: 8.2
npm_config_cache: $(Pipeline.Workspace)/.npm
COMPOSER_CACHE_DIR: $(Pipeline.Workspace)/.composer
steps:
- script: |
sudo update-alternatives --set php /usr/bin/php$(phpVersion)
sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
php -version
displayName: 'Use PHP version $(phpVersion)'
- task: NodeTool@0
inputs:
versionSource: 'spec'
versionSpec: '20.x'
- task: Cache@2
inputs:
key: 'npm | "$(Agent.OS)" | package-lock.json'
restoreKeys: |
npm | "$(Agent.OS)"
path: $(npm_config_cache)
displayName: Cache npm
- task: Npm@1
inputs:
command: 'ci'
displayName: NPM Clean Install
- task: Npm@1
inputs:
command: 'custom'
customCommand: 'run build'
displayName: NPM Build
- task: Npm@1
inputs:
command: 'custom'
customCommand: 'prune --omit=dev'
displayName: NPM Prune Dev Deps
- task: replacetokens@6
inputs:
sources: 'lmc-search-plugin.php'
addBOM: true
- task: DeleteFiles@1
inputs:
SourceFolder:
Contents: |
/node_modules
/.git
/.git*
RemoveDotFiles: true
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Pipeline.Workspace)'
artifact: 'lmc-search-plugin'
publishLocation: 'pipeline'