This repository has been archived by the owner on Mar 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
812 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
language: ruby | ||
|
||
rvm: | ||
- 2.7.1 | ||
|
||
env: | ||
global: | ||
# Speeds up installation of html-proofer. | ||
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true | ||
|
||
# Use Bundler 2.0. | ||
# See https://docs.travis-ci.com/user/languages/ruby/#bundler-20. | ||
before_install: | ||
- yes | gem update --system --force | ||
- gem install bundler | ||
|
||
script: bundle exec rake | ||
|
||
notifications: | ||
email: | ||
on_success: never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
gem 'github-pages', group: :jekyll_plugins | ||
# Fix CVE-2020-7595. | ||
# https://github.com/advisories/GHSA-7553-jr98-vx47 | ||
gem 'nokogiri', '>= 1.10.8' | ||
|
||
group :production do | ||
# Latest version available: | ||
# https://pages.github.com/versions/ | ||
gem 'github-pages', '~> 207', group: :jekyll_plugins | ||
end | ||
|
||
group :development do | ||
gem 'rake', group: :test | ||
end | ||
|
||
group :test do | ||
gem 'html-proofer', '~> 3.15' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
# frozen_string_literal: true | ||
|
||
task default: ['build', 'test:run'] | ||
|
||
# ------------------------------ # | ||
# Dependencies | ||
# ------------------------------ # | ||
|
||
desc 'Install all the dependencies' | ||
task install: ['bundle:unset_deployment_mode', 'bundle:unset_without'] do | ||
Rake::Task['bundle:install'].execute | ||
Rake::Task['yarn:install'].execute | ||
end | ||
|
||
desc 'Install only the production dependencies' | ||
task install_prod: ['bundle:set_deployment_mode', 'bundle:without_non_prod'] do | ||
Rake::Task['bundle:install'].execute | ||
Rake::Task['yarn:install_prod'].execute | ||
end | ||
|
||
desc 'Upgrade all the dependencies' | ||
task :upgrade do | ||
Rake::Task['bundle:update'].execute | ||
Rake::Task['yarn:upgrade'].execute | ||
end | ||
|
||
namespace :bundle do | ||
desc 'Install Ruby dependencies using Bundler' | ||
task :install do | ||
sh 'bundle install' | ||
end | ||
|
||
desc 'Update Ruby dependencies using Bundler' | ||
task :update do | ||
sh 'bundle update' | ||
end | ||
|
||
desc 'Enable deployment mode in Bundler' | ||
task :set_deployment_mode do | ||
sh 'bundle config set deployment \'true\'' | ||
end | ||
|
||
desc 'Disable deployment mode in Bundler' | ||
task :unset_deployment_mode do | ||
sh 'bundle config unset deployment' | ||
end | ||
|
||
desc 'Set the \'without\' option in Bundler for non-production ' \ | ||
'dependencies' | ||
task :without_non_prod do | ||
sh 'bundle config set without \'deployment test\'' | ||
end | ||
|
||
desc 'Unset the \'without\' option in Bundler' | ||
task :unset_without do | ||
sh 'bundle config unset without' | ||
end | ||
end | ||
|
||
namespace :yarn do | ||
desc 'Install all the JavaScript dependencies using Yarn' | ||
task :install do | ||
sh 'yarn install' | ||
end | ||
|
||
desc 'Install only the production JavaScript dependencies using Yarn' | ||
task :install_prod do | ||
sh 'yarn install --production' | ||
end | ||
|
||
desc 'Upgrade the JavaScript dependencies using Yarn' | ||
task :upgrade do | ||
sh 'yarn upgrade' | ||
end | ||
end | ||
|
||
# ------------------------------ # | ||
# Build | ||
# ------------------------------ # | ||
|
||
desc 'Build the website' | ||
task build: ['install'] do | ||
Rake::Task['jekyll:build'].execute | ||
end | ||
|
||
desc 'Build the production-ready website' | ||
task deploy: ['install_prod'] do | ||
Rake::Task['jekyll:build'].execute | ||
end | ||
|
||
namespace :jekyll do | ||
desc 'Build the Jekyll website' | ||
task :build do | ||
sh 'bundle exec jekyll build' | ||
end | ||
|
||
desc 'Clean the Jekyll website' | ||
task :clean do | ||
sh 'bundle exec jekyll clean' | ||
end | ||
|
||
desc 'Serve the Jekyll website locally' | ||
task :serve do | ||
sh 'bundle exec jekyll serve --future --drafts --incremental' | ||
end | ||
end | ||
|
||
# ------------------------------ # | ||
# Test | ||
# ------------------------------ # | ||
|
||
namespace :test do | ||
desc 'Run all tests' | ||
task :run do | ||
Rake::Task['test:check_html'].execute | ||
end | ||
|
||
desc 'Check the HTML syntax' | ||
task :check_html do | ||
require 'html-proofer' | ||
|
||
options = { | ||
assume_extension: true, | ||
check_favicon: true, | ||
check_opengraph: true, | ||
only_4xx: true | ||
} | ||
|
||
HTMLProofer.check_directory('./_site', options).run | ||
end | ||
end | ||
|
||
# ------------------------------ # | ||
# Clean up | ||
# ------------------------------ # | ||
|
||
desc 'Delete the build artifacts' | ||
task :cleanup do | ||
Rake::Task['jekyll:clean'].execute | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.