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'