BryanSchuetz / jekyll-deploy-gh-pages

A GitHub Action for building a Jekyll site (with custom plugins) and deploying it back to your gh-pages branch.
118 stars 60 forks source link

bundler: command not found: jekyll #9

Closed dseeker closed 4 years ago

dseeker commented 4 years ago

trying to figure out why getting this errors when building, can you help?

Run BryanSchuetz/jekyll-deploy-gh-pages@master
/usr/bin/docker run --name bb814967a782a7284fbd905279f32fdc4fc2_14e40d --label 04bb81 --workdir /github/workspace --rm -e GITHUB_TOKEN -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/landing-filmin-global/landing-filmin-global":"/github/workspace" 04bb81:4967a782a7284fbd905279f32fdc4fc2
👍 ENTRYPOINT HAS STARTED—INSTALLING THE GEM BUNDLE
👍 BUNDLE INSTALLED—BUILDING THE SITE
bundler: command not found: jekyll
Install missing gem executables with `bundle install`
👍 THE SITE IS BUILT—PUSHING IT BACK TO GITHUB-PAGES
/entrypoint.sh: 8: cd: can't cd to build
Reinitialized existing Git repository in /github/workspace/.git/
Files to Commit:15
đź‘Ť GREAT SUCCESS!
BryanSchuetz commented 4 years ago

Looks like your gems aren’t being installed. Do you have a Gemfile in the root of your repository? What does your workflow look like? If you link up your repo I can have a look for you if you like.

dseeker commented 4 years ago

Yes I do.

source "https://rubygems.org"
gem "jekyll", "~> 3.8.6"

group :jekyll_plugins do
  gem "jekyll-feed"
  gem "jekyll-menus"
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
dseeker commented 4 years ago

I just cloned a ubuild template in forestry and tried adding an Action https://forestry.io/blog/ubuild-a-new-theme-for-static-sites-using-blocks/

BryanSchuetz commented 4 years ago

I updated the action to show errors from the bundle install—so you should be able to see this for yourself, but it looks like the Gemfile is pinned to bundler 2.0.2 I think you should be able to remove:

BUNDELED WITH 2.0.2 from the Gemfile.lock file and have it build correctly. Don't forget that you also need to change the destination in jekyll to a build directory.

dseeker commented 4 years ago

Thanks for the help, I ended up putting together another Action recipe. I don't really like that it commits to the same branch first and then copy the folder to gh-pages, but I can live with it

name: Jekyll Build & Deploy

on:
  push:
    branches:
    - master

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Build jekyll/builder
      run: |
        docker run \
        -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
        jekyll/builder:latest /bin/bash -c "chmod 777 /srv/jekyll && jekyll build --future"
    - name: Commit to Master
      uses: github-actions-x/commit@v2.1
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        push-branch: 'master'
        commit-message: '[ Generate Jekyll Website ]'
        force-add: 'true'
    - name: Deploy to gh-pages
      uses: docker://peaceiris/gh-pages:v2.5.0
      env:
        ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
        PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
        PUBLISH_BRANCH: gh-pages
        PUBLISH_DIR: ./_site