Trying to cache npm salesforce installs between builds on Azure Devops pipeline
but iam unable to do this i traied to below existing code
setup-dependencies.yml
---------------------------
steps:
- task: NodeTool@0
inputs:
versionSpec: '17.x'
checkLatest: false
- bash: ls -d -- */
displayName: Navigate to directory
- bash:
npm install sfdx-cli@latest-rc --location=global
displayName: Install Salesforce CLI
--------------------------------------------------------------------
in the above code i training to implement cache concept ,
but iam not geting it,please help on this,the below code what iam training to
variables:
npm_config_cache: $(Pipeline.Workspace)/.npm
steps:
- task: Cache@2
inputs:
key: 'npm | "$(Agent.OS)" | package-lock.json'
restoreKeys: |
npm | "$(Agent.OS)"
path: $(npm_config_cache)
displayName: Cache npm
- script: npm ci