前言
当我们完成对前端Html页面的开发工作想把页面分享给其他人查看与使用时,我们需要把页面部署到公网服务器上,对于处于学习阶段的个人开发者来说,购买云服务器的成本有些高,把自己的电脑暴露向公网又有些得不偿失,那么没有有除了以上两种方案的第三种可能呢?答案是肯定的,借助Github的github.io,我们可以很容易的实现部署开发Html页面到公网。
创建仓库
第一步,我们需要把npm run build产生的dist目录与index.html存入一个目录,并进行Git初始化。

第二步,通过github的客户端,把本地git仓库添加到我们的GitHub。

第三步,提交代码到Github。

第四布,在Github上创建gh-pages分支。

第五步,将代码提交到gh-pages分支。

第六步,通过github.io查看效果。查看地址为https://github用户名.github.io/工程名。
网友评论