-
Notifications
You must be signed in to change notification settings - Fork 47
Description
In the past I was using another Docker based Jekyll action https://github.com/helaili/jekyll-action [1].
However this recently stopped working and that action was deprecated with the notice remarking that using Docker for Jekyll is bad and should be avoided [2].
After much research and troubleshooting, I finally arrived at a working solution [3] but then I found this action which is described as "part of the official support", however it uses a Docker based action again, which I just moved away from because it should not be used according to https://github.com/helaili/jekyll-action.
Now I'm thoroughly confused: who is right now? Should I stick with the custom workflow [3] or adopt the official solution even though it uses a Docker based action that is supposed to be slow, hard to debug and not reproducible?
[1] Like this:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-gems-
- uses: helaili/jekyll-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
target_branch: 'static'
[2]
GitHub has a new way to publish a static site to Pages using GitHub Actions. This means you can now build with the Jekyll command (or something else) and use actions to publish, all using regular steps. This removes the need for Docker based actions and gives you all the freedom to configure the execution environment (versions of Ruby, extra dependencies...), it is a lot faster, easier to debug and closer to what you can run on your local machine.
[3]
name: Build and deploy Jekyll site to GitHub Pages
on:
workflow_dispatch:
push:
branches:
- master
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/configure-pages@v5
- run: bundle exec jekyll build
- uses: actions/upload-pages-artifact@v3
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/deploy-pages@v4