Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test PR

on:
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
build:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
# this is required for the subsequent build to be able to push to the registry on localhost:5000
driver-opts: network=host

- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: localhost:5000/kroxy-jekyll:latest
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build with Jekyll
run: |
docker run \
--rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/site" \
localhost:5000/kroxy-jekyll:latest \
bash -c 'eval "$(rbenv init -)" && cp -r /css/_sass/bootstrap /site/_sass/ && JEKYLL_ENV=production bundle exec jekyll build --config=_config.yml'
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN apt-get update && \
wget \
golang && \
rm -rf /var/lib/apt/lists/*
ENV RBENV_ROOT /usr/local/rbenv
ENV RBENV_ROOT=/usr/local/rbenv
RUN git clone https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && \
git clone https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build

Expand Down Expand Up @@ -45,4 +45,4 @@ RUN mkdir /site/
WORKDIR /site/
EXPOSE 4000
# Note --incremental mode is ineffective on the Mac owing to https://github.com/containers/podman/issues/22343. Use force_regenerate.sh to trigger the incremental reload after changing the file on the host.
CMD eval "$(rbenv init -)" && cp -r /css/_sass/bootstrap /site/_sass/ && bundle exec jekyll serve --host ${JEKYLL_SERVE_BIND} --incremental --disable-disk-cache --destination /tmp/site
CMD [ "bash", "-c", "eval \"$(rbenv init -)\" && cp -r /css/_sass/bootstrap /site/_sass/ && bundle exec jekyll serve --host ${JEKYLL_SERVE_BIND} --incremental --disable-disk-cache --destination /tmp/site"]