Skip to content

Commit

Permalink
Fix caching in build workflow example
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzschmid committed Feb 15, 2021
1 parent 282d354 commit de77779
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 27 deletions.
2 changes: 1 addition & 1 deletion _config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ sass:
# Additional exclude from processing
exclude:
- .github/
- venv/
- README.md
- LICENSE.md
- REDISTRIBUTED.md
- purgecss.config.js

# Collections and their defaults
collections:
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ exclude:
- REDISTRIBUTED.md
- screenshot.png
- jekyll-theme-conference.gemspec
- purgecss.config.js
- _config.example.yml

# Collections and their defaults
Expand Down
29 changes: 4 additions & 25 deletions _tools/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,11 @@ jobs:
with:
lfs: true

- name: Setup Ruby
uses: actions/setup-ruby@v1

- name: Ruby Cache
id: cache_ruby
uses: actions/cache@v2
- name: Setup Ruby, Bundler and Jekyll
uses: ruby/setup-ruby@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
- name: Install Bundler and Jekyll
if: steps.cache_ruby.outputs.cache-hit != 'true'
run: |
gem install bundler
bundle install --path vendor/bundle
ruby-version: 2.6
bundler-cache: true

- name: Build website
run: |
Expand All @@ -59,16 +47,7 @@ jobs:
with:
node-version: '12'

- name: NPM Cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install PurgeCSS and Terser
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install -g purgecss
npm install -g terser
Expand Down
2 changes: 1 addition & 1 deletion _tools/purgecss.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
content: ['_site/**/*.html','_site/assets/js/main.js'],
css: ['_site/assets/css/main.css'],
output: '_site/assets/css/main.min.css',
output: '_site/assets/css/main.css',
fontFace: true,
safelist: {
deep: [/^leaflet/]
Expand Down

0 comments on commit de77779

Please sign in to comment.