Closed KonradHoeffner closed 1 month ago
https://github.com/helaili/jekyll-action is marked as deprecated, I think it doesn't support Ruby version 3 and we need to change the workflow.
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.
You can check the documentation for more information on how to do this.
Maintaining this action was a great experience, but as there is now a better solution availabe I do encourage everyone to move over.
I couldn't find a clear gold standard way of doing it like helaili/jekyll action describes it and ended up with this working solution:
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
However contrary to the statement from helaili/jekyll action, there is https://github.com/actions/jekyll-build-pages which is "part of the official support for building Pages with Actions", so maybe we should switch to that?
This should also now be adopted for HITO and ANNO, however I first want to wait for responses to https://github.com/actions/jekyll-build-pages/issues/134 on whether it is better to use https://github.com/actions/jekyll-build-pages/ instead.
This needs to be changed because the deploy-pages action does not create a branch, so we cannot check it out on the webserver. https://github.com/actions/jekyll-build-pages seems to upload it to an artifact, so it seems https://github.com/JamesIves/github-pages-deploy-action is actually the one we need.
This probably needs to be fixed for all similar sites: SNIK, HITO, ANNO.