forked from forem/forem
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (35 loc) · 1.03 KB
/
create-cache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Create CI cache
on:
push:
branches:
- main
jobs:
build-cache:
runs-on: ubuntu-latest
env:
E2E: true
RAILS_ENV: test
NODE_ENV: test
steps:
- uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Cache pre-compiled assets
uses: actions/cache@v4
id: assetscache
with:
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-
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn
if: steps.assetscache.outputs.cache-hit != 'true'
- run: yarn install --immutable
if: steps.assetscache.outputs.cache-hit != 'true'
- run: bundle exec rails assets:precompile
if: steps.assetscache.outputs.cache-hit != 'true'