Skip to content

Commit

Permalink
Merge pull request #760 from alexwlchan/run-in-macos-jekyll
Browse files Browse the repository at this point in the history
Allow running in macOS Ruby rather than Docker
  • Loading branch information
alexwlchan authored Apr 7, 2024
2 parents 51f3322 + 556e470 commit a5376e2
Show file tree
Hide file tree
Showing 48 changed files with 950 additions and 1,032 deletions.
44 changes: 37 additions & 7 deletions .github/workflows/build_site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,28 @@ jobs:
- name: "Check out the repo"
uses: actions/checkout@v4

- name: "Set up Ruby"
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
cache-version: 1

# Not all the gems get installed properly for some reason, and
# I get errors like:
#
# `require': cannot load such file -- json-schema (LoadError)
#
# Try installing them manually instead.
- run: gem install html-proofer json-schema nokogiri

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- run: pip install -r requirements.txt

- name: "Cache site output"
uses: "actions/cache@v4"
with:
Expand All @@ -50,10 +72,10 @@ jobs:
restore-keys: "jekyll-cache-"

- name: "Build the site"
run: make html-drafts
run: bundle exec jekyll build --drafts

- name: "Run linting"
run: make lint
run: ruby scripts/linter.rb

- name: "Publish drafts"
if: github.ref == 'refs/heads/main'
Expand All @@ -67,17 +89,25 @@ jobs:
git config --global --add safe.directory /home/runner/work/alexwlchan.net/alexwlchan.net
make publish-drafts
make html
ruby scripts/publish_drafts.rb
bundle exec jekyll build
else
echo "There is no _drafts folder, so nothing to publish!"
fi
- name: "Deploy to Netlify"
if: github.ref == 'refs/heads/main'
run: make deploy-prod
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: "_site"
production-branch: main
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: true
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: "da37a488-4df9-4cc2-b267-947179af20bd"
timeout-minutes: 1

- name: "Push any commits to GitHub"
if: github.ref == 'refs/heads/main'
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,9 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
ruby-version: "3.3"

- name: Run rubocop
run: |
# Note: the version of RuboCop is pinned because of a known issue
# with redundant parentheses in 1.58.0 and later that affects
# the `linter.rb` plugin.
# See https://github.com/rubocop/rubocop/issues/12556
gem install rubocop -v 1.57.2
gem install rubocop -v 1.62.1
rubocop
27 changes: 24 additions & 3 deletions .github/workflows/run_plugin_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,27 @@ jobs:
- name: "Check out the repo"
uses: actions/checkout@v4

- name: Run the tests
run: |
make plugin-tests
- name: "Set up Ruby"
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
cache-version: 1

# nokogiri doesn't get installed properly for some reason, and
# I get errors like:
#
# `require': cannot load such file -- nokogiri (LoadError)
#
# Try installing it manually instead.
- run: gem install nokogiri

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- run: pip install -r requirements.txt

- name: "Run the plugin tests"
run: ruby src/_tests/tests.rb
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
.jekyll-metadata
.sass-cache
_site
.missing_images.json
.header_colours.txt

.DS_Store
25 changes: 0 additions & 25 deletions Dockerfile

This file was deleted.

6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ source 'https://rubygems.org'

gem 'chunky_png', '~> 1.4'
gem 'color', '~> 1.8'
gem 'html-proofer', '~> 3.19'
gem 'html-proofer', '~> 5'
gem 'jekyll', '~> 4'
gem 'jekyll-include-cache', '~> 0.2'
gem 'json-schema', '~> 3.0'
gem 'json-schema', '~> 4'
gem 'nokogiri', '~> 1.12'
gem 'rszr', '~> 1.0'
gem 'rubocop', '~> 1.62'
gem 'shell-executer', '~> 1.0'
111 changes: 80 additions & 31 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.1)
Ascii85 (1.1.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
afm (0.2.2)
ast (2.4.2)
async (2.10.1)
console (~> 1.10)
fiber-annotation
io-event (~> 1.5, >= 1.5.1)
timers (~> 4.1)
bigdecimal (3.1.7)
chunky_png (1.4.0)
color (1.8)
colorator (1.1.0)
concurrent-ruby (1.1.10)
concurrent-ruby (1.2.3)
console (1.23.6)
fiber-annotation
fiber-local
json
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
Expand All @@ -15,21 +28,27 @@ GEM
eventmachine (1.2.7)
expectations (2.0.0)
mocha (>= 0.5.5)
ffi (1.15.5)
ffi (1.16.3)
fiber-annotation (0.2.0)
fiber-local (1.0.0)
forwardable-extended (2.6.0)
google-protobuf (3.21.12)
html-proofer (3.19.4)
google-protobuf (4.26.1)
rake (>= 13)
hashery (2.1.2)
html-proofer (5.0.8)
addressable (~> 2.3)
mercenary (~> 0.3)
async (~> 2.1)
nokogiri (~> 1.13)
parallel (~> 1.10)
pdf-reader (~> 2.11)
rainbow (~> 3.0)
typhoeus (~> 1.3)
yell (~> 2.0)
zeitwerk (~> 2.5)
http_parser.rb (0.8.0)
i18n (1.12.0)
i18n (1.14.4)
concurrent-ruby (~> 1.0)
jekyll (4.3.1)
io-event (1.5.1)
jekyll (4.3.3)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
Expand All @@ -51,65 +70,95 @@ GEM
sass-embedded (~> 1.54)
jekyll-watch (2.2.1)
listen (~> 3.0)
json-schema (3.0.0)
json (2.7.2)
json-schema (4.3.0)
addressable (>= 2.8)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
language_server-protocol (3.17.0.3)
liquid (4.0.4)
listen (3.8.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
mini_portile2 (2.8.1)
mocha (2.0.2)
mini_portile2 (2.8.5)
mocha (2.1.0)
ruby2_keywords (>= 0.0.5)
nokogiri (1.14.0)
mini_portile2 (~> 2.8.0)
nokogiri (1.16.3)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
open4 (1.3.4)
parallel (1.22.1)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.1)
racc (1.6.2)
pdf-reader (2.12.0)
Ascii85 (~> 1.0)
afm (~> 0.2.1)
hashery (~> 2.0)
ruby-rc4
ttfunk
public_suffix (5.0.5)
racc (1.7.3)
rainbow (3.1.1)
rake (13.0.6)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (4.0.1)
rszr (1.3.0)
regexp_parser (2.9.0)
rexml (3.2.6)
rouge (4.2.1)
rubocop (1.62.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
ruby-progressbar (1.13.0)
ruby-rc4 (0.1.5)
ruby2_keywords (0.0.5)
safe_yaml (1.0.5)
sass-embedded (1.57.1)
google-protobuf (~> 3.21)
rake (>= 10.0.0)
sass-embedded (1.74.1)
google-protobuf (>= 3.25, < 5.0)
rake (>= 13.0.0)
shell-executer (1.0.1)
expectations
open4
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
typhoeus (1.4.0)
timers (4.3.5)
ttfunk (1.8.0)
bigdecimal (~> 3.1)
typhoeus (1.4.1)
ethon (>= 0.9.0)
unicode-display_width (2.4.2)
webrick (1.7.0)
unicode-display_width (2.5.0)
webrick (1.8.1)
yell (2.2.2)
zeitwerk (2.6.13)

PLATFORMS
ruby

DEPENDENCIES
chunky_png (~> 1.4)
color (~> 1.8)
html-proofer (~> 3.19)
html-proofer (~> 5)
jekyll (~> 4)
jekyll-include-cache (~> 0.2)
json-schema (~> 3.0)
json-schema (~> 4)
nokogiri (~> 1.12)
rszr (~> 1.0)
rubocop (~> 1.62)
shell-executer (~> 1.0)

BUNDLED WITH
Expand Down
Loading

1 comment on commit a5376e2

@alexwlchan
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://alexwlchan.net as production
🚀 Deployed on https://6612e6bfbdfc6fec19ba021d--alexwlchan.netlify.app

Please sign in to comment.