fix(ci): delete old prod build caches on cache miss (#26437)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Keith Williams
2026-01-04 18:26:01 -03:00
committed by GitHub
co-authored by Devin AI
parent 897c9d65f0
commit aca3b1ecdb
@@ -4,6 +4,7 @@ on:
permissions:
contents: read
actions: write
env:
ALLOWED_HOSTNAMES: ${{ vars.CI_ALLOWED_HOSTNAMES }}
@@ -44,4 +45,26 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- name: Generate cache key
id: cache-key
uses: ./.github/actions/cache-build-key
with:
branch_key: ${{ github.head_ref || github.ref_name }}
- name: Check if production build cache exists
uses: actions/cache@v4
id: cache-check
with:
path: |
${{ github.workspace }}/apps/web/.next
${{ github.workspace }}/apps/web/public/embed
**/.turbo/**
**/dist/**
key: ${{ steps.cache-key.outputs.key }}
lookup-only: true
- name: Delete old production build caches for this branch
if: steps.cache-check.outputs.cache-hit != 'true'
uses: useblacksmith/cache-delete@v1
with:
key: prod-build-${{ github.head_ref || github.ref_name }}
prefix: "true"
- uses: ./.github/actions/cache-build