126
108

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Github pages に 特定のディレクトリだけデプロイする

Posted at

SPAなサイトを作ってると、ディレクトリのほとんどがソースコードで、public/ だか dist/ だけ公開したいケースがあると思います。

そういうときはgit subtree コマンドで特定ディレクトリだけを新しいブランチとして切り出してpushします

$ git subtree push --prefix public/ origin gh-pages

参考: [Deploy to gh-pages from a dist folder on the master branch. Useful for use with yeoman.](https://gist.github.com/cobyism/4730490 "Deploy to gh-pages from a dist folder on the master branch. Useful for use with yeoman.")

deploy.sh とかにこれだけ書いとけばいいかもしれませんね。drone.ioのCIにやらせても良いかも。

126
108
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
126
108

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?