Skip to content

Instantly share code, notes, and snippets.

@yoppi
Last active December 16, 2021 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoppi/170b7055499f7cd9e2994a56777f8016 to your computer and use it in GitHub Desktop.
Save yoppi/170b7055499f7cd9e2994a56777f8016 to your computer and use it in GitHub Desktop.
GitHub Actions上でのbundle installのキャッシュ

モチベーション

毎回bundle installするのはコストがかかるため、Gemfileに変更がない場合はキャッシュしたい。

参考 https://blog.freks.jp/github-action-cache/

+      - name: cache bundle directory
+        uses: actions/cache@v1
+        with:
+          path: vendor/bundle
+          key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}

bundle installする手前のstepに挟むだけで動作する。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment