I created a build definition in vsts with npm build and then I copy the build folder to the drop location.
The build pipeline is working fine
Then I created
Per Azure official document for setting up Pipelines (YAML files) for Node.js
, Javascript
apps from this link https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/javascript?view=azure-devops&tabs=code
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build
displayName: 'npm install and build'
- task: CopyFiles@2
inputs:
Contents: 'build/**' # Pull the build directory (React)
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory) # dist or build files
ArtifactName: 'www' # output artifact named www
On the latest version of Azure Devops
, edit Release
under Pipeline
. Note that Build
section has been taken off in the latest version (as of June 2020), so some older answers/docs was not working.
Click on Deploy Azure App Services
and on the right panel click on ...
(Expand Folder) for Package or folder
Option
Under Linked Artifacts
=> MyProject (Build)
=> www
, select dist
folder.
Save this and then create release, this should solve the error [error]Error: No package found with the specified pattern: D:\a\r1\a\**\*.zip