feat: add cache build action

This commit is contained in:
nafees nazik
2024-01-04 23:41:24 +05:30
parent 0a9006430f
commit e470020b16

25
.github/actions/cache-build/action.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: Cache production build binaries
description: 'Cache or restore if necessary'
inputs:
node_version:
required: false
default: v18.x
runs:
using: 'composite'
steps:
- name: Cache production build
uses: actions/cache@v3
id: production-build-cache
env:
cache-name: prod-build
with:
path: |
${{ github.workspace }}/apps/web/.next
${{ github.workspace }}/apps/marketing/.next
**/.turbo/**
**/dist/**
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.run_id }}
- run: npm run build
if: steps.production-build-cache.outputs.cache-hit != 'true'