Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何自动部署简单的Vue WebApp(无需服务器)?(即使用vue的简单构建链)_Javascript_Vue.js_Npm_Continuous Integration_Npm Scripts - Fatal编程技术网

Javascript 如何自动部署简单的Vue WebApp(无需服务器)?(即使用vue的简单构建链)

Javascript 如何自动部署简单的Vue WebApp(无需服务器)?(即使用vue的简单构建链),javascript,vue.js,npm,continuous-integration,npm-scripts,Javascript,Vue.js,Npm,Continuous Integration,Npm Scripts,我已经编写了一个小型Vue应用程序,并一直在寻找一种很好的方法来自动化其部署,即调用lint->test->build->upload to some web space(stage and/or production)(sftp)。基本上是一个简单的CI/CD管道 我找了一个任务执行者,比如grunt(似乎有一点,文档对我帮助不大)和gulp(另请参阅),还考虑定义一个npm脚本。像Jenkins这样的CI工具似乎有点过大,需要进行一些设置 npm脚本可能是simples解决方案,特别是因为我

我已经编写了一个小型Vue应用程序,并一直在寻找一种很好的方法来自动化其部署,即调用lint->test->build->upload to some web space(stage and/or production)(sftp)。基本上是一个简单的CI/CD管道

我找了一个任务执行者,比如grunt(似乎有一点,文档对我帮助不大)和gulp(另请参阅),还考虑定义一个npm脚本。像Jenkins这样的CI工具似乎有点过大,需要进行一些设置

npm脚本可能是simples解决方案,特别是因为我可以简单地链接lint/test/build:

{
  "scripts": {
    "build": "vue-cli-service build --modern",
    "lint": "vue-cli-service lint",
    "prettier": "prettier --write src/**/*.{ts,js,vue,css,less,scss,html,json,md} public/**/*.{ts,js,vue,css,less,scss,html,json,md} test/**/*.{js,vue,css,less,scss,html,json,md} build/*.js",
    "deploy": "# ...?",
    "pipeline": "yarn lint && yarn prettier && yarn test && yarn build && yarn deploy"
  },
但是,我还不知道如何将构建部署到web服务器上。对于grunt,我找到了一些可能适合(,)的任务。但格伦特似乎不是现在的首选

有人有什么建议吗


其他信息:我正在使用Windows,我不想在github上发布我的源代码(在本例中)

部署静态站点的最简单方法是使用pages.github.com-只需在github repo中推送构建即可

另一个简单(超级简单)服务是-只需使用
npm install netlify cli-g
安装即可

但如果您需要更好的CI,则不需要搜索“vue部署”,您需要来自github、bitbucket、gitlab等的任何CI服务。例如-


回到你的问题-你使用linux/mac还是windows?
它在linux上非常简单,只需从/local/dir使用类似于
scp的命令to@remote/dir
。在windows上,您可能应该尝试一些nodejs替代方案,如snippet from

谢谢您的快速回答,我扩展了上面的问题:我正在使用windows,我不想发布我的源代码(在这种情况下)在github上。我将看一看netlify和上面提到的答案。如果您不想,您可以不在github上部署源代码或其他任何东西。您始终只能推送dist(或任何名为的构建文件夹)使用根目录中的minified build和index.html。之后,对于github,您只需设置
>单击设置选项卡并向下滚动到github页面部分。>然后选择主分支源代码并单击保存按钮。