[CI] Add cache creator (#20740)
This commit is contained in:
parent
83878e9c10
commit
e817378413
1 changed files with 36 additions and 0 deletions
36
.github/workflows/create-cache.yml
vendored
Normal file
36
.github/workflows/create-cache.yml
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
name: Create CI cache
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
install:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
bundler-cache: true
|
||||
- name: Cache node_modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-node-modules-v2-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: ${{ runner.os }}-node-modules-v2-
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: yarn
|
||||
- run: yarn install --immutable
|
||||
- name: cache compiled assets exist
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
fail-on-cache-miss: false
|
||||
path: |
|
||||
public/assets
|
||||
key: ${{ runner.os }}-compiled-assets-v3-${{ hashFiles('app/assets/**', 'app/javascript/**', '**/package.json', '**/yarn.lock') }}
|
||||
restore-keys: ${{ runner.os }}-compiled-assets-v3-
|
||||
- run: bundle exec rails assets:precompile
|
||||
Loading…
Add table
Reference in a new issue