Closed michaelmior closed 4 years ago
Closing this issue since there hasn't been any activity in almost 2 years. @michaelmior @OriolAbril feel free to re-open if this feature ask is still relevant for you.
@c-w I would certainly still be interested in this feature although I'm not sure I have time right now to devote to implementing it myself.
@michaelmior Could you provide some more details on your use-case, e.g. with an illustrative example? Is it about deploying multiple specific folders to different branches or is it about deploying files to sub folders on the gh-pages branch?
@c-w In the case of something like documentation, I'd like to be able to build the documentation for each branch and have it deployed in a subfolder named after the branch. So the main branch documentation would be available at /main
, the dev branch at /dev
, and so on.
@michaelmior I just merged a pull request that adds an option -x
or --prefix
which should achieve the functionality you're looking for.
Specifically assuming a directory structure like this:
docs
├── images
│ ├── bg_hr.png
│ └── sprite_download.png
├── index.html
└── style.css
Then running ghp-import --prefix=dev ./docs
will create the following directory structure on the gh-pages
branch:
dev
└── docs
├── images
│ ├── bg_hr.png
│ └── sprite_download.png
├── index.html
└── style.css
Wow, that was fast. Thanks! Does it also keep other directories? For example, when I publish the dev branch, will it leave whatever was already published in the main folder alone?
Yes, it should be preserving history/existing directories.
@c-w Thanks so much! I'll try to give this a shot later this week.
I'd like to be able to have docs for several branches concurrently. For example, I want /master/ to have docs for the master branch, /dev/ to have docs for the dev branch and so on. It would be great if there was an option to deploy a specific folder, leaving others untouched.