Skip to content

Commit 0eb3cb0

Browse files
committed
ci: bump ruby version / add docker-build / ghrc package / verify Gemfile.lock updates
1 parent a7bea66 commit 0eb3cb0

3 files changed

Lines changed: 52 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
ruby: [ '2.7', '3.0.1' ]
11+
ruby: [ '3.0.1' ]
1212
name: Ruby ${{ matrix.ruby }}
1313
steps:
1414
- uses: actions/checkout@v3
@@ -21,3 +21,51 @@ jobs:
2121
run: bundle install --jobs 4 --retry 3
2222
- name: build site
2323
run: bundle exec jekyll build --limit-posts 10
24+
docker-build:
25+
runs-on: ubuntu-22.04
26+
name: Dockerised Jekyll Build
27+
steps:
28+
- uses: actions/checkout@v3
29+
- name: Get changed files
30+
id: changes
31+
uses: dorny/paths-filter@v3
32+
with:
33+
filters: |
34+
rebuild:
35+
- 'Dockerfile'
36+
- 'Gemfile'
37+
- 'Gemfile.lock'
38+
- '.github/workflows/ci.yml'
39+
diff_gemfile:
40+
- 'Gemfile.lock'
41+
- name: ghcr login
42+
uses: docker/login-action@v3
43+
with:
44+
registry: ghcr.io
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
- name: monero-site ruby build env (pull or build)
48+
run: |
49+
tag_name="ghcr.io/${GITHUB_REPOSITORY_OWNER}/monero-site-ruby:latest"
50+
case "${{ steps.changes.outputs.rebuild }}" in
51+
true)
52+
docker build -t "$tag_name" .
53+
;;
54+
*)
55+
docker pull "$tag_name" || docker build -t "$tag_name" .
56+
;;
57+
esac
58+
- name: Build Jekyll site with Docker
59+
run: docker run -v $(pwd):/srv/jekyll ghcr.io/${GITHUB_REPOSITORY_OWNER}/monero-site-ruby bundle exec jekyll build --limit-posts 10
60+
- name: Push new image to ghcr
61+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
62+
run: docker push -a ghcr.io/${GITHUB_REPOSITORY_OWNER}/monero-site-ruby
63+
- name: Confirm Gemfile update
64+
if: steps.changes.outputs.diff_gemfile
65+
run: |
66+
cp Gemfile.lock Gemfile.lock.update
67+
docker run -v $(pwd):/srv/jekyll ghcr.io/${GITHUB_REPOSITORY_OWNER}/monero-site-ruby bundle update
68+
if ! diff Gemfile.lock Gemfile.lock.update; then
69+
echo "Gemfile.lock updates do not match"
70+
exit 1
71+
fi

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.1
1+
3.0.1

netlify.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
command = "jekyll build --trace --limit-posts 10"
44

55
[build.environment]
6-
RUBY_VERSION = "2.7.1"
6+
RUBY_VERSION = "3.0.1"
77

88
[build.processing]
9-
skip_processing = true
9+
skip_processing = true

0 commit comments

Comments
 (0)