[英]How do I deploy react app on user pages (Github)?
I am trying to deploy a react app, but specifically on user page on github pages.我正在尝试部署一个 React 应用程序,但特别是在 github 页面上的用户页面上。 I can see a LOT of resources for deploying to project page, but nothing yet for user page.我可以看到很多用于部署到项目页面的资源,但还没有用于用户页面的资源。 Please help!!!请帮忙!!!
I have tried switching the gh-pages line in the package.json file to include master, but even then I will have to update the gh-pages branch, it doesn't deploy directly from master.我已经尝试将 package.json 文件中的 gh-pages 行切换为包含 master,但即使那样我也必须更新 gh-pages 分支,它不会直接从 master 部署。 I want to be able to deploy directly from master.我希望能够直接从 master 部署。
gitname/react-gh-pages
is one good example, and applies to a user site, where GitHub requires that the repository's name have the following format: {username}.github.io
(eg gitname.github.io
). gitname/react-gh-pages
是一个很好的例子,适用于用户站点,其中 GitHub 要求存储库的名称具有以下格式: {username}.github.io
(例如gitname.github.io
)。
But it uses the gh-pages
branch as publication source , not master
(which no longer exists anyway, since it was renamed to main since Oct. 2020)但它使用gh-pages
分支作为发布源,而不是master
(无论如何不再存在,因为它自 2020 年 10 月起更名为 main )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.