LoginSignup
108

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.

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

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
108