Skip to content

Instantly share code, notes, and snippets.

@ThomasPe
Created August 22, 2021 20:20
Show Gist options
  • Save ThomasPe/569af8a2cb6fc1523797e9b4d35110f1 to your computer and use it in GitHub Desktop.
Save ThomasPe/569af8a2cb6fc1523797e9b4d35110f1 to your computer and use it in GitHub Desktop.
Angular => Azure DevOps => Azure BLOB Storage Deployment
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '14.x'
displayName: 'Install Node.js'
- script: |
npm install -g @angular/cli
npm install
ng build --prod
displayName: 'npm install and build'
- task: AzureCLI@2
displayName: 'Clear Static website'
inputs:
azureSubscription: 'My Subscription'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: 'az storage blob delete-batch --account-name mystorageaccount --source "\$web"'
- task: AzureCLI@2
displayName: 'Upload new Static Website'
inputs:
azureSubscription: 'My Subscription'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: 'az storage blob upload-batch --account-name mystorageaccount --destination "\$web" --source ''$(Build.Repository.LocalPath)/dist/myappname'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment