# Caching dependencies to speed up workflows. (GitHub will remove any cache entries that have not been accessed in over 7 days.) 缓存压缩 node_modules,不用每次下载,使用时解压,可以加快工作流的执行过程,超过 7 天没有使用将删除压缩包。 -name:Cachenodemodules# step2 uses:actions/cache@v1 id:cache with: path:node_modules key:${{runner.os}}-node-${{hashFiles('**/package-lock.json')}} restore-keys:| ${{ runner.os }}-node- -name:InstallDependencies# step3 name if:steps.cache.outputs.cache-hit!='true'# 如果变量 cache-hit 不等于 true run:npminstall# 安装 node modules 相关依赖