From e470020b166abf37975034c73d2efac5a59b305f Mon Sep 17 00:00:00 2001 From: nafees nazik Date: Thu, 4 Jan 2024 23:41:24 +0530 Subject: [PATCH] feat: add cache build action --- .github/actions/cache-build/action.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/actions/cache-build/action.yml diff --git a/.github/actions/cache-build/action.yml b/.github/actions/cache-build/action.yml new file mode 100644 index 000000000..6fba4f745 --- /dev/null +++ b/.github/actions/cache-build/action.yml @@ -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'