美文网首页
将Vue项目部署到Github Page上

将Vue项目部署到Github Page上

作者: 董可伦 | 来源:发表于2021-07-14 13:57 被阅读0次

    我的原创地址:https://dongkelun.com/2019/06/04/vueDeployGithubPages/

    前言

    本文讲如何将Vue项目的dist文件夹部署到Github Page上,目的是可以在线访问前端效果,这样不需要自己购买服务器,当然任何静态文件夹都可以这样做,不止局限于Vue

    操作步骤

    1、首先在Git上建立一个项目,如vue-echarts-map


    2、然后将本地项目push到远程master (非必须)

    echo "# vue-echarts-map" >> README.md
    git init
    git add README.md
    git commit -m "first commit"
    git remote add origin https://github.com/dongkelun/vue-echarts-map.git
    git push -u origin master
    

    3、主要是下面这一步,将打包后的dist文件夹push到gh-pages

    npm run build
    git checkout -b gh-pages
    git add -f dist
    git commit -m 'first commit'
    git subtree push --prefix dist origin gh-pages
    

    这样就可以直接在浏览器查看效果了http://gh.dongkelun.com/vue-echarts-map

    备注:1、我这里做了域名绑定 dongkelun.github.io=>gh.dongkelun.com 没有域名的直接访问http://dongkelun.github.io/vue-echarts-map
    2、还有首先你先创建一个类似yourgithubname.github.io这样格式的GitHub仓库,然后按上面把dist文件夹(即静态文件夹)push到gh-pages分支,就会自动部署了。
    域名绑定只需在dongkelun.github.io仓库做一次即可,即加一个CNAME,然后域名加解析,这里不做详细说明~
    3、如果你不用gh-pages分支,或者你不想分享源代码,你可以直接将dist文件夹push到master分支,但是需要自己在Setting里设置,用哪个分支部署,默认是gh-pages分支
    echarts-map

    参考:如何在 GitHub Pages 上部署 vue-cli 项目

    每日英语

    Logistic regression is a popular method to predict a categorical response. It is a special case of Generalized Linear models that predicts the probability of the outcomes. In spark.ml logistic regression can be used to predict a binary outcome by using binomial logistic regression, or it can be used to predict a multiclass outcome by using multinomial logistic regression. Use the family parameter to select between these two algorithms, or leave it unset and Spark will infer the correct variant.
    以下为谷歌浏览器翻译:
    逻辑回归是预测分类响应的常用方法。广义线性模型的一个特例是预测结果的概率。在spark.ml逻辑回归中,可以使用二项逻辑回归来预测二元结果,或者可以使用多项逻辑回归来预测多类结果。使用该family 参数在这两种算法之间进行选择,或者保持不设置,Spark将推断出正确的变量。

    相关文章

      网友评论

          本文标题:将Vue项目部署到Github Page上

          本文链接:https://www.haomeiwen.com/subject/ohsypltx.html