Skip to content

Commit 9514e5b

Browse files
committed
Add CI to check that we can build the production site
Signed-off-by: Robert Young <[email protected]>
1 parent f51dd04 commit 9514e5b

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/pr-build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
2+
name: Test PR
3+
4+
on:
5+
pull_request:
6+
types: [ opened, synchronize, reopened ]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
services:
12+
registry:
13+
image: registry:2
14+
ports:
15+
- 5000:5000
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
with:
23+
# this is required for the subsequent build to be able to push to the registry on localhost:5000
24+
driver-opts: network=host
25+
26+
- name: Build Docker image
27+
uses: docker/build-push-action@v6
28+
with:
29+
context: .
30+
push: true
31+
tags: localhost:5000/kroxy-jekyll:latest
32+
cache-from: type=gha
33+
cache-to: type=gha,mode=max
34+
35+
- name: Build with Jekyll
36+
run: |
37+
docker run \
38+
--rm \
39+
-u "$(id -u):$(id -g)" \
40+
-v "$(pwd):/site" \
41+
localhost:5000/kroxy-jekyll:latest \
42+
bash -c 'eval "$(rbenv init -)" && cp -r /css/_sass/bootstrap /site/_sass/ && JEKYLL_ENV=production bundle exec jekyll build --config=_config.yml'

0 commit comments

Comments
 (0)