如何使用Netlify部署项目的部分存储库?
它只有一个“主”分支,包括前端和后端部分。当我部署该应用程序以使用GIT的存储库NETLIFY时,它要求我选择要部署的分支,并且由于该项目只有一个主要分支,因此我推向NetLify的内容包括后端。您仅如何从原始存储库中部署所需的零件?
It has only one "main" branch including the front-end and back-end sections. When I deploy the app to Netlify with Git's repository, it asks me to choose the branch I want to deploy and because the project has only one main branch, what I push to Netlify includes the back-end. How do you deploy only the parts that you want from the original repository?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 netlify docs :
base directory:base base directory:可链接莫诺波斯或网站的可选字段建立在存储库的子目录中。它指定了我们的构建机器人在启动构建之前更改为的目录。这是我们的构建系统检查依赖项管理文件(例如package.json或.nvmrc)的地方。如果未设置,则基本目录默认为存储库的根。
发布目录:目录(相对于回购的根),其中包含构建生成的已部署的HTML文件和资产。如果指定了基本目录,则应将其包含在发布目录路径中。例如,如果您的基本目录设置为网站,则发布目录应包括网站/前缀,例如:site/ public。访问框架文档以了解有关流行工具的典型设置。
因此,如果您的
client
文件夹是前端代码寿命并包含指定依赖项等的文件,请将其设置为NetLify UI或配置文件中的base Directory
。还要查看有关:
From Netlify docs:
Base directory: optional field for linking monorepos or sites built from a subdirectory of a repository. It specifies the directory that our buildbot changes to before starting a build. It’s where our build system checks for dependency management files such as package.json or .nvmrc. If not set, the base directory defaults to the root of the repository.
Publish directory: directory (relative to the root of your repo) that contains the deploy-ready HTML files and assets generated by the build. If a base directory has been specified, it should be included in the publish directory path. For example, if your base directory is set to site, the publish directory should include the site/ prefix like so: site/public. Visit the frameworks doc to learn about typical settings for popular tools.
So if your
client
folder is where the front end code lives and contains the files that specify the dependencies and so on, set it as theBase directory
in Netlify UI or configuration files.Check also de docs about: