github-pages - 如何在 Github Pages 上修改已部署的 create-react-app?
问题描述
我混合使用这两个教程( https://create-react-app.dev/docs/deployment和https://github.com/gitname/react-gh-pages在 GitHub Pages 上部署了一个 create-react-app )。它工作得很好。
但是这个网页应该会定期更新,我有一些内容要补充。
有没有办法修改已部署的应用程序?如何将我在本地目录中所做的更改推送到 gh-pages(生产模式)?添加后是否需要再次运行 npm build ?
目前我在 master 分支上有开发模式。我认为这是 gh-pages 上的构建模式,虽然我没有任何其他分支。
谢谢您的帮助。
我做了什么部署:
终端
$ npm install --save gh-pages
$ git init
$ git remote add origin https://github.com/REMOTE
$ npm run deploy
包.json
{
"homepage": "https://USER-PAGE.github.io/",
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -b master -d build",
},
"devDependencies": {
"gh-pages": "^2.1.1"
}
}
解决方案
要修改站点,只需进行更改,然后像通常对所需分支所做的那样 git add、commit 和 push。
然后再次运行命令:
npm run deploy
推荐阅读
- javascript - 反应原生选择按钮和计数
- pdf - iTextSharp 添加的页脚和水印没有出现在 Edge 中,但在 Chrome 中可以
- sql - 跨表查询
- mongodb - mongodb 聚合 $max 和相应的时间戳
- css - 模块 CSS 未在项目中加载
- python - 如何构建使用 Swagger 生成的 Flask 应用程序
- javascript - 使用按钮 HighStocks 更改窗口位置
- oracle - EclipseLink:使用 IN 表类型调用 oracle StoredFunc
- php - 如何定位不同级别的 Wordpress 分类?
- c# - 使用 Avro 将 GenericRecord 转换为 SpecificRecord 对象