1.把项目推到github仓库

新建github仓库后根据提示把本地仓库推送到github仓库

…or push an existing repository from the command line
git remote add origin https://github.com/ilses1/screen.git
git branch -M main
git push -u origin main

注意需要网络通畅

2.把打包好的文件push到新分支

把子目录下的dist文件 单独push到 gh-pages分支,

便于部署github pages

git subtree push --prefix dist origin gh-pages

3.github仓库设置中部署pages

setting中选择pages

选择推送的gh-pages分支,然后选择save

稍等刷新一下就有顶部的网址了,可以访问了

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐