Warm tip: This article is reproduced from serverfault.com, please click

Jekyll Github Actions pipeline stuck at jekyll build

发布于 2020-11-27 23:49:25

I've been working on a pipeline to build and deploy my Jekyll Site via ssh to a webserver. I've found this GithubAction and tried to reproduce it. Here is my .yml

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - name: 🛎 Check out master
        uses: actions/checkout@master
        with:
          fetch-depth: 1
      - name: 🎩 Install Jekyll
        run: |
          sudo gem install bundler jekyll
          sudo bundle install
      - name: 🧹 Clean site
        run: |
          if [ -d "docs" ]; then
            rm -rf docs/*
          fi
      - name: 🔨 Build site
        run: bundle exec jekyll build -d docs

When running my pipeline it gets stuck at the beginning of the 🔨 Build site step. It was stuck until i manually canceled it after 18min.

Github Action error

Running the build command locally works. Any idea what the mistake is? Or there better ways to achieve what i want?

Questioner
Deitsch
Viewed
0
Deitsch 2020-12-01 04:21:07

After trying out various Github Actions i've solved by doing it myself using the Jekyll Builder Docker Image.

Care: you need to pre create .jekyll-cache and _site because the container does not have the permission to do so. It's a known issue.

- name: 🔨 Build site
      run: |
        mkdir .jekyll-cache _site
        docker run --rm -v ${{ github.workspace }}:/srv/jekyll jekyll/builder:latest jekyll build

After running this command you can do whatever with the _site folder. In my case i compressed it and moved it to my server with appleboys scp-action.