github - Github 操作如何仅进行 1 次 npm 安装
问题描述
我正在使用 GitHub 操作进行部署。而且我每次推送时都需要构建 vuejs 应用程序。现在一切正常,但每次我花几分钟时间安装 npm。
我可以安装 1 次模块,而不是在每次部署后重新安装吗?
on: push
name: Deploy website on push
jobs:
web-deploy:
name: Deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [15.x]
steps:
- name: Get latest code
uses: actions/checkout@v2.3.2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install --legacy-peer-deps
- run: npm run build
- name: Sync files
uses: SamKirkland/FTP-Deploy-Action@4.0.0
with:
server: ${{ secrets.host}}
username: ${{ secrets.user}}
password: ${{ secrets.pass }}
local-dir: dist/
dangerous-clean-slate: true
解决方案
推荐阅读
- node.js - Mongoose 在聚合用户中找到除一个之外的所有用户
- python - .pyc 扩展名 Django Visual Studio 代码
- reactjs - React - 传递数据的嵌套级别
- python - 获取当前(或基本)python 日志配置作为字典
- sql - Oracle - 仅从列中选择最大值
- sails.js - 无法通过 Sails.js 上的 cors 获得 csrf
- c# - 如何在 Windows 窗体中创建和处理多个异常?
- python - Keras 输入形状问题
- ios - 通过 WKWebView 对 HTTP 请求使用代理
- reactjs - 反应隐藏文本区域但可写