I want to deploy an Angular application to an Azure Static Web Application.The build part works fine but the release errors and says it can not find the build artifact : Directory Location: 'dist' is invalid. Could not detect this directory. Please verify your deployment configuration file reflects your repository structure.
This is the YAML used for the application publish, screenshot below that.
steps:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: dist'
inputs:
PathtoPublish: dist
ArtifactName: dist
So it seems that we are not using the correct publish location but not sure what to use.
The following is the YAML from the pipeline :
steps:
- task: Npm@1
displayName: 'npm custom'
inputs:
command: custom
verbose: false
customCommand: 'install @angular/cli -g'
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
steps:
- task: Npm@1
displayName: 'npm build'
inputs:
command: custom
verbose: false
customCommand: 'run build -- --configuration=production'
steps:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: dist'
inputs:
PathtoPublish: dist/CarehomeBooking
ArtifactName: dist
The directory structure of the built Angular app is :