-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
42 lines (38 loc) · 1006 Bytes
/
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
parameters:
- name: environment
displayName: Environment
type: string
default: development
values:
- development
- production
trigger:
branches:
include:
- main
paths:
exclude:
- .vscode
- .gitignore
- README.md
pr:
branches:
include:
- main
paths:
exclude:
- .vscode
- .gitignore
- README.md
pool:
vmImage: ubuntu-latest
stages:
- ${{ if or(ne(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.Reason'], 'PullRequest')) }}:
- template: .azure-pipelines/stages/test-stage.yaml
parameters:
projectDirectory: $(Build.Repository.LocalPath)
- ${{ if and(eq(variables['Build.SourceBranch'], 'refs/heads/main'), ne(variables['Build.Reason'], 'PullRequest')) }}:
- template: .azure-pipelines/stages/deploy-stage.yaml
parameters:
projectDirectory: $(Build.Repository.LocalPath)
environment: ${{ parameters.environment }}