c-w / ghp-import

Easily import docs to your gh-pages branch.
https://pypi.org/project/ghp-import/
Apache License 2.0
602 stars 79 forks source link

Allow deployment to a specific folder, keeping others #74

Closed michaelmior closed 4 years ago

michaelmior commented 5 years ago

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.

c-w commented 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.

michaelmior commented 4 years ago

@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.

c-w commented 4 years ago

@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?

michaelmior commented 4 years ago

@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.

c-w commented 4 years ago

@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
c-w commented 4 years ago

This has been released in 0.6.0.

michaelmior commented 4 years ago

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?

c-w commented 4 years ago

Yes, it should be preserving history/existing directories.

michaelmior commented 4 years ago

@c-w Thanks so much! I'll try to give this a shot later this week.