Skip to content

Instantly share code, notes, and snippets.

@ErikAndreas
Last active April 18, 2021 20:59
Show Gist options
  • Save ErikAndreas/0c30f0e1ee79a76548df9c0ebb36a870 to your computer and use it in GitHub Desktop.
Save ErikAndreas/0c30f0e1ee79a76548df9c0ebb36a870 to your computer and use it in GitHub Desktop.
Static angular site Azure DevOps pipeline Static web site deploy to Azure blob GPv2. Define variables (jsonpath) for file transform
pool:
vmImage: Hosted Ubuntu 1604
demands: npm
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- task: Npm@1
displayName: 'npm run'
inputs:
command: custom
verbose: false
customCommand: 'run build:prod'
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: dist
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
steps:
- task: FileTransform@1
displayName: 'File Transform: '
inputs:
folderPath: '$(System.DefaultWorkingDirectory)/_<buildname>/drop'
fileType: json
targetFiles: '**/appConfig.json'
- task: AzureFileCopy@3
displayName: 'AzureBlob File Copy'
inputs:
SourcePath: '$(System.DefaultWorkingDirectory)/_<buildname>/drop'
azureSubscription: '<subscription name>'
Destination: AzureBlob
storage: <storageaccountname>
ContainerName: '$web'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment