Skip to content

Commit db83e9f

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 db83e9f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/pr-build.yml

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