Skip to content

Commit

Permalink
Merge branch 'main' into blog-objectmapper-mock-contstructor
Browse files Browse the repository at this point in the history
  • Loading branch information
normartin committed Nov 8, 2023
2 parents 80c939d + 7473f35 commit 34055dd
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 16 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: PR build

on: [pull_request]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: |
mkdir -p _site
./go.sh build
16 changes: 16 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ruby:2.7

ENV BUNDLE_GEMFILE=/app/bundle/Gemfile

WORKDIR /app/bundle

ADD Gemfile .
ADD Gemfile.lock .

RUN bundle install

RUN mkdir /app/src

WORKDIR /app/src

ENTRYPOINT ["bundle", "exec", "jekyll"]
File renamed without changes.
4 changes: 2 additions & 2 deletions Gemfile.lock → docker/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ GEM
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.16.1)
ffi (1.16.3)
forwardable-extended (2.6.0)
http_parser.rb (0.8.0)
i18n (0.9.5)
Expand Down Expand Up @@ -89,4 +89,4 @@ DEPENDENCIES
wdm (~> 0.1.0)

BUNDLED WITH
2.0.2
2.1.4
30 changes: 16 additions & 14 deletions go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,32 @@ set -e
export JEKYLL_VERSION=3.8

goal_serve() {
docker run --rm \
--volume="$PWD:/srv/jekyll:Z" \
--volume="$PWD/vendor/bundle:/usr/local/bundle:Z" \
--env FORCE_POLLING=true \
-p 4000:4000 \
-p 40000:40000 \
-it jekyll/builder:$JEKYLL_VERSION \
jekyll serve --drafts --livereload --livereload_port 40000 --force_polling --incremental
goal_docker

docker run --rm -p 4000:4000 -p 40000:40000 -v $(pwd):/app/src jekyll-container serve\
--host 0.0.0.0 --drafts --livereload --livereload_port 40000 --force_polling
}

goal_build() {
docker run --rm \
--volume="$PWD:/srv/jekyll:Z" \
--volume="$PWD/vendor/bundle:/usr/local/bundle:Z" \
--env JEKYLL_ENV=production \
jekyll/builder:$JEKYLL_VERSION \
jekyll build
goal_docker
rm -rf _site
docker run --rm -p 4000:4000 -p 40000:40000 --env JEKYLL_ENV=production -v $(pwd):/app/src jekyll-container build


}

goal_docker() {
docker build -t jekyll-container docker

docker run --rm --entrypoint cat jekyll-container /app/bundle/Gemfile.lock > docker/Gemfile.lock
}

goal_help() {
echo "usage: $0 <goal>
available goals
serve -- serve the blog locally (http://localhost:4000)
build -- build the blog (builds static artifact for publishing)
docker -- creates docker build image (tag: jekyll-container)
"
exit 1
}
Expand Down

0 comments on commit 34055dd

Please sign in to comment.