Skip to content

vue和react部署到github-pages #23

@innerWang

Description

@innerWang

react

参考deployment

vue

参考deploy

  1. 在项目根目录下手动添加 vue.config.js 设置 publicPath
  2. 添加 deploy.sh脚本文件,修改对应项,主要是下述中的 username 以及 repo
    git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages
  3. 执行脚本
    • linux下需要 chmod +x deploy.sh; 然后 ./deploy.sh
    • windows下直接在根目录执行 bash deploy.sh

再去看github上对应的仓库,则会在gh-pages分支下发现上传的 dist 文件夹里面的内容,同时查看settings,GitHub Pages选项已自动设置了预览连接,点击则可看到对应的首页。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions