以下のように Git root directory ではなく sub directory にデプロイしたいアプリケーションが存在する場合を想定。
$ tree -L 2 . ├── .git ├── frontend │ ├── README.md │ ├── config │ ├── images.d.ts │ ├── node_modules │ ├── package.json │ ├── public │ ├── scripts │ ├── src │ ├── tsconfig.json │ ├── tsconfig.prod.json │ ├── tsconfig.test.json │ ├── tslint.json │ └── yarn.lock ├── backend └── netlify.toml
Deploy context を設定する必要があるので、Git root directory に置く netlify.toml に以下のように記述する。
[build] base = "frontend" publish = "frontend/build" command = "yarn build"
Netlify の管理画面では Build command も Publish directory も記述しない。
いま趣味で作っている Good First Issues を探す web application のフロントエンドはこの方式でデプロイしている。