helaili / jekyll-action

A GitHub Action to publish Jekyll based content as a GitHub Pages site
MIT License
250 stars 120 forks source link

Adding input variable for site and GemFile under sub directory #31

Closed abhishekmit1982 closed 4 years ago

abhishekmit1982 commented 4 years ago

Adding support for github pages site and GemFile under subdirectory on the master branch. Usage

`jobs: build: runs-on: ubuntu-latest github-pages: runs-on: ubuntu-16.04 steps:

helaili commented 4 years ago

There is already a jekyll_src parameter for this action (see the code sample in the README). Is it similar?

r4zzz4k commented 4 years ago

jekyll_src parameter is passed as --source to jekyll. bundle, which is invoked earlier, still expects Gemfile to reside in the root folder. I'm keeping everything related to static site in it's own directory, so jekyll_src is of no help for me (see https://github.com/inkremental/inkremental/tree/master/docs for the reference).

Both my and @abhishekmit1982 take is to add an option to change the directory entirely before running other commands. The downside is the fact that vendor/bundle cache is also moved, one should change it's location to some well-known location.

@limjh16 proposed another interesting option of passing additional --gemfile parameter to bundle. I've just tried this, it seems to be working as expected with some changes to parameters:

bundle update --gemfile docs/Gemfile 
bundle exec --gemfile docs/Gemfile jekyll serve -s docs -d docs/_site

I'm not seeing any downsides to it, there are no files in the root directory after running this. So I'm actually leaning to it. Unfortunately jekyll_src doesn't tweak Jekyll output directory, and making it so would be a breaking change. Also Gemfile location tweaking could be either relative to working directory or jekyll_src value.

WDYT?

helaili commented 4 years ago

Understood, that makes sense. I'm not going to have much time to work on this within the next couple days, but happy to review and merge a refined PR.

r4zzz4k commented 4 years ago

My second take on this feature, based on --gemfile this time, can be found at #35.

helaili commented 4 years ago

Fixed with #35