Skip to content

Commit

Permalink
Fix gh-actions cache not being hit issue (cotes2020#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Dec 6, 2020
1 parent a1f72f2 commit 6fbac28
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ jobs:
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
ruby-version: 2.7

- name: Bundle Caching
uses: actions/cache@v2
with:
path: ${{ env.GEMS_PATH }}
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pages-deploy.yml.hook
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
ruby-version: 2.7

- name: Bundle Caching
uses: actions/cache@v2
with:
path: ${{ env.GEMS_PATH }}
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-

Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
else
bash tools/test.sh
fi

- name: Deploy
run: |
bash tools/deploy.sh
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
.*
!.github

# jekyll cache
# jekyll cache
_site
Gemfile.lock
vendor
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ gem "jekyll", ">= 3.8.6", "< 5.0"
group :jekyll_plugins do
gem "jekyll-paginate"
gem "jekyll-redirect-from"
gem "jekyll-seo-tag", "~> 2.6.1"
gem "jekyll-seo-tag"
gem "jekyll-archives"
gem "jekyll-sitemap"
end

group :test do
gem "html-proofer", "~> 3.16.0"
gem "html-proofer"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
Expand Down
111 changes: 111 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.7)
em-websocket (0.5.2)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
ethon (0.12.0)
ffi (>= 1.3.0)
eventmachine (1.2.7)
ffi (1.13.1)
forwardable-extended (2.6.0)
html-proofer (3.17.4)
addressable (~> 2.3)
mercenary (~> 0.3)
nokogumbo (~> 2.0)
parallel (~> 1.3)
rainbow (~> 3.0)
typhoeus (~> 1.3)
yell (~> 2.0)
http_parser.rb (0.6.0)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
jekyll (4.1.1)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
pathutil (~> 0.9)
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (~> 1.8)
jekyll-archives (2.2.1)
jekyll (>= 3.6, < 5.0)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.7.1)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.3.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.3.3)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
mini_portile2 (2.4.0)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
nokogumbo (2.0.4)
nokogiri (~> 1.8, >= 1.8.4)
parallel (1.20.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
rainbow (3.0.0)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.4)
rouge (3.25.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.8)
thread_safe (~> 0.1)
tzinfo-data (1.2020.4)
tzinfo (>= 1.0.0)
unicode-display_width (1.7.0)
wdm (0.1.1)
yell (2.2.2)

PLATFORMS
ruby

DEPENDENCIES
html-proofer
jekyll (>= 3.8.6, < 5.0)
jekyll-archives
jekyll-paginate
jekyll-redirect-from
jekyll-seo-tag
jekyll-sitemap
tzinfo (~> 1.2)
tzinfo-data
wdm (~> 0.1.1)

BUNDLED WITH
2.1.4
10 changes: 10 additions & 0 deletions tools/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ _no_branch=false
_backup_dir="$(mktemp -d)"

init() {
if [[ -z ${GITHUB_ACTION+x} ]]; then
echo "ERROR: This script is not allowed to run outside of GitHub Action."
exit -1
fi

# Gemfile could be changed by `bundle install` in actions workflow
if [[ -n $(git status Gemfile.lock --porcelain) ]]; then
git checkout -- Gemfile.lock
fi

if [[ -z $(git branch -av | grep "$PAGES_BRANCH") ]]; then
_no_branch=true
git checkout -b "$PAGES_BRANCH"
Expand Down

0 comments on commit 6fbac28

Please sign in to comment.