cal.pub0.org/.github/actions/cache-build/action.yml

23 lines
810 B
YAML

name: Cache production build binaries
description: "Cache or restore if necessary"
env:
node_version: v16.x
runs:
using: "composite"
steps:
- name: Cache production build
uses: actions/cache@v3
env:
cache-name: prod-build
key-1: ${{ env.node_version }}-${{ hashFiles('yarn.lock') }}
key-2: ${{ hashFiles('apps/web/next.config.js') }}
key-3: ${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
with:
path: |
${{ github.workspace }}/apps/web/.next/cache
**/.turbo/**
**/dist/**
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-