Skip to content

Commit 63dde36

Browse files
committed
Remove the Caching bundle install manually section
* It is too error prone and the automatic approach is a lot safer and easier.
1 parent fde3324 commit 63dde36

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

README.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -140,35 +140,6 @@ If there is a `Gemfile.lock` (or `$BUNDLE_GEMFILE.lock` or `gems.locked`), `bund
140140
To perform caching, this action will use `bundle config --local path vendor/bundle`.
141141
Therefore, the Bundler `path` should not be changed in your workflow for the cache to work (no `bundle config path`).
142142

143-
### Caching `bundle install` manually
144-
145-
You can also cache gems manually,
146-
but this is not recommended because it is verbose and very difficult to use a correct cache key.
147-
You can cache the installed gems with these two steps:
148-
149-
```yaml
150-
- uses: actions/cache@v2
151-
with:
152-
path: vendor/bundle
153-
key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
154-
restore-keys: |
155-
bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-
156-
- name: bundle install
157-
run: |
158-
bundle config deployment true
159-
bundle config path vendor/bundle
160-
bundle install --jobs 4
161-
```
162-
163-
When using a single OS, replace `${{ matrix.os }}` with the OS.
164-
When using a single job with a Ruby version, replace `${{ matrix.ruby }}` with the Ruby version.
165-
When using `.ruby-version`, replace `${{ matrix.ruby }}` with `${{ hashFiles('.ruby-version') }}`.
166-
When using `.tool-versions`, replace `${{ matrix.ruby }}` with `${{ hashFiles('.tool-versions') }}`.
167-
168-
This uses the [cache action](https://github.com/actions/cache).
169-
The code above is a more complete version of the [Ruby - Bundler example](https://github.com/actions/cache/blob/master/examples.md#ruby---bundler).
170-
Make sure to include `use-ruby` in the `key` to avoid conflicting with previous caches.
171-
172143
## Windows
173144

174145
Note that running CI on Windows can be quite challenging if you are not very familiar with Windows.

0 commit comments

Comments
 (0)