我们可以在GitHub存储库中部署特定文件夹吗?

发布于 2025-02-08 20:06:42 字数 361 浏览 2 评论 0 原文

我已经在Github的“前端项目”上创建了一个存储库。该计划是在难度不同的情况下制定前端项目。因此,存储库将具有许多嵌套文件夹。

现在,问题在于我正在尝试部署我在Netlify上创建的网站的文件夹,但我无法访问该文件夹,而仅访问了存储库。有什么方法可以部署这些项目?

我的文件夹层次结构就是这样。 “前端项目”是我在github上推出的存储库:

Folder hierarchy

I have made a repository on Github "Front-end Projects". The plan is to make front-end projects with different difficulty levels. Hence, the repository is going to have many nested folders.

Now, the problem is I am trying to deploy a folder of a website I created on netlify but I cannot access the folder but only the repository. Is there any way to deploy these projects?

My folder hierarchy is like this. "Front-end Project" is the Repository I pushed on GitHub:

Folder hierarchy

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

無心 2025-02-15 20:06:42

for netlify支持

有些项目播放在文件夹中,而不是git存储库的根部。

如果您需要从子目录部署网站,则有两种方法:

  1. 您可以在UI中进行设置:

在您要配置的特定网站的网站仪表板中,转到 settings>构建&部署>构建
该选项标记为基本目录

  1. 或者,您可以使用 netlify.toml 文件并设置基本dir:

  [构建]
 base =“子目录”
 发布=“ subdirectory/dist/”
 命令=“您的构建命令”
 

现在,您的构建将从上面提到的子目录文件夹中使用!如果您有任何问题,请在下面发表评论。

请注意,启用基础设置可能会对您的网站产生其他影响,这些效果在本文 我们的文档

For Netlify support

There are some projects that live in a folder instead of the root of your git repository.

If you need to deploy your site from a subdirectory, there are two ways to do it:

  1. You can set this in the UI:
    https://aws1.discourse-cdn.com/netlify/original/2X/7/763e3be54cbcfa9187754c7626816ed69a8ddf66.png

In your site dashboard for the specific site you want to configure, go to Settings > Build & deploy > build-settings.
The option is labeled Base directory.

  1. Or, your can use a netlify.toml file and set the base dir:
[build]
 base    = "subdirectory"
 publish = "subdirectory/dist/"
 command = "your build command"

Now, your builds will work from the subdirectory folder mentioned above! If you have any issues, comment below.

Note that enabling the base setting can have other effects on your site, which are described in this article and in more detail in our documentation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文