如果gatsby网站嵌套在仓库中的文件夹中,该如何在netlify上进行部署?

时间:2019-10-03 16:49:00

标签: gitlab gatsby netlify

我必须在netlify上为我的大学部署一个gatsby网站。我在gitlab上有两个子文件夹,这两个子文件夹都是单独的gatsby项目。我认为部署失败,因为它尝试部署不是gatsby项目的master文件夹。我将Build命令的“ npm run build”和“ gatsbyjs-starter-tailwindplay / public”插入到Publish目录中。这是告诉netlify应该部署gatsbyjs-starter-tailwindplay文件夹的正确方法,而gatsbyjs-starter-tailwindplay是回购子文件夹之一?

我得到以下部署日志:

def arbUnicodeGen(size: Int) = 
  Gen.listOfN(size, Arbitrary.arbChar.arbitrary).map(_.mkString)

Root:

However if I go into the gatsbyjs-starter-tailwindplay folder there is no public folder, but it is definitely there in my cloned repo on my PC!

但是,如果我进入gatsbyjs-starter-tailwindplay文件夹,则没有公用文件夹,但肯定是在我的PC上的克隆存储库中!不应该对git超级有经验。仅具有默认gatsby初始页的回购协议是相同的,我可以很好地部署它,所以我认为应该是这样的!!

2 个答案:

答案 0 :(得分:0)

如果在存储库根目录中添加netlify.toml文件会怎样?

# Settings in the [build] context are global and are applied to all contexts
# unless otherwise overridden by more specific contexts.
[build]
  # Directory to change to before starting a build.
  # This is where we will look for package.json/.nvmrc/etc.
  base = "gatsbyjs-starter-tailwindplay/"

  # Directory (relative to root of your repo) that contains the deploy-ready
  # HTML files and assets generated by the build. If a base directory has
  # been specified, include it in the publish directory path.
  publish = "gatsbyjs-starter-tailwindplay/public/"

  # Default build command.
  command = "npm run build"

public.cache文件夹是gatsby构建过程的结果。它们被.gitignore文件中的git设置为忽略。

答案 1 :(得分:0)

我遇到了同样的问题,所以我使用了submodules

但是Netlify刚刚启动了this功能。

相关问题