forked from rstacruz/cheatsheets
-
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.
Tech improvement: Fix CSS, and enable minification (rstacruz#1472)
- Loading branch information
Showing
9 changed files
with
100 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Build and test CI | ||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# https://github.com/actions/cache/blob/master/examples.md#node---yarn | ||
- name: "Cache: Get yarn cache directory path" | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: "Cache: Set up yarn cache" | ||
uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
# https://github.com/actions/cache/blob/master/examples.md#ruby---bundler | ||
- name: "Cache: Set up bundler cache" | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: { node-version: '12.x' } | ||
|
||
- name: Use Ruby | ||
uses: actions/setup-ruby@v1 | ||
with: { ruby-version: '2.7.1' } | ||
|
||
- name: Setup dependencies | ||
run: | | ||
yarn --frozen-lockfile | ||
bundle config path vendor/bundle | ||
bundle install --jobs 4 --retry 3 | ||
- run: yarn build | ||
- run: yarn test | ||
- run: yarn test:smoke |
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
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,32 @@ | ||
#!/usr/bin/env bash | ||
set -eou pipefail | ||
|
||
exit_failure() { | ||
echo 'Failed :(' | ||
echo '' | ||
echo ' If your build failed at this point, it means' | ||
echo ' the site failed to generate. Check the project' | ||
echo ' out locally and try to find out why.' | ||
} | ||
|
||
trap exit_failure ERR | ||
|
||
|
||
files=( | ||
_site/vim.html | ||
_site/react.html | ||
_site/index.html | ||
) | ||
|
||
for fn in "${files[@]}"; do | ||
echo '' | ||
echo -n "→ Checking: $fn... " | ||
test -f "$fn" | ||
grep -q '<script src' "$fn" | ||
grep -q 'assets/packed/app.js' "$fn" | ||
grep -q 'doctype html' "$fn" | ||
grep -q 'link rel="canonical"' "$fn" | ||
done | ||
echo '' | ||
echo '' | ||
echo "✓ Smoke tests good :)" |
This file was deleted.
Oops, something went wrong.
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,16 @@ | ||
[build] | ||
command = "yarn build" | ||
publish = "_site/" | ||
|
||
# [[plugins]] | ||
# # https://www.npmjs.com/package/netlify-plugin-minify-html | ||
# package = "netlify-plugin-minify-html" | ||
# | ||
# [plugins.inputs] | ||
# contexts = [ 'production', 'branch-deploy', 'deploy-preview' ] | ||
# | ||
# # https://github.com/kangax/html-minifier#options-quick-reference | ||
# [plugins.inputs.minifierOptions] | ||
# removeComments = true | ||
# minifyCSS = true | ||
# minifyJS = true |
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 was deleted.
Oops, something went wrong.