Skip to content

Instantly share code, notes, and snippets.

@abhilashca
Created July 4, 2023 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhilashca/46065f336f1791e4b0554f89bacbb7f1 to your computer and use it in GitHub Desktop.
Save abhilashca/46065f336f1791e4b0554f89bacbb7f1 to your computer and use it in GitHub Desktop.
Azure DevOps: CI/CD for Umbraco v11 deployment in Azure Web App Linux
trigger:
- develop
pool:
vmImage: ubuntu-latest
variables:
solution: 'path-to-solution'
project: 'path-to-project'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
#1 Nuget tool install
- task: NuGetToolInstaller@1
displayName: Install Nuget
#2 Nuget Restore
- task: NuGetCommand@2
displayName: Restore Nuget packages
inputs:
restoreSolution: '$(solution)'
#3 Build the VS Project
- task: DotNetCoreCLI@2
displayName: Build project
inputs:
command: 'build'
projects: '$(project)'
configuration: '$(buildConfiguration)'
arguments: '--configuration $(buildConfiguration) --runtime ubuntu.22.04-x64'
- task: DotNetCoreCLI@2
displayName: 'Publish Artifact'
inputs:
command: 'publish'
publishWebProjects: true
arguments: '--configuration $(buildConfiguration) --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:
appType: webAppLinux
azureSubscription: '$(AzureSubscription)'
appName: '$(AppName)'
deploymentMethod: zipDeploy
package: '$(Build.ArtifactStagingDirectory)/**/*.zip'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment