-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy-app.yaml
60 lines (53 loc) · 1.49 KB
/
deploy-app.yaml
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
trigger:
branches:
include:
- main
paths:
exclude:
- docker/*
- 'deploy-app.yaml'
- 'README.md'
pool:
name: Default # change ADO Agent Pool name to suit your environment if required.
demands:
- agent.name -equals self-hosted # change agent name equals to suit your environment if required.
# Fill variables with your values
variables:
- name: webAppName
value: 'app-ado-uks-demo'
- name: azureServiceConnection
value: 'AzureSubWorkloadFederationId'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk 7.0.x'
inputs:
packageType: 'sdk'
version: '7.0.x'
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: DotNetCoreCLI@2
displayName: 'Build .NET App'
inputs:
command: 'build'
projects: 'app/app-ado-uks-demo/*.csproj'
arguments: '--configuration Release'
- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: publish
publishWebProjects: false
projects: 'app/app-ado-uks-demo/*.csproj'
arguments: '--configuration Release --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
- task: AzureWebApp@1
displayName: 'Deploy to Azure Web App'
inputs:
azureSubscription: $(azureServiceConnection)
appType: 'webApp'
appName: $(webAppName)
package: '$(Build.ArtifactStagingDirectory)/*.zip'
deploymentMethod: runFromPackage