Skip to content

Commit 42bf5ff

Browse files
committed
fix(ci): clear Docker builder cache before builds
Fixes stale cache issue on self-hosted runners causing lockfile mismatch.
1 parent 00f239a commit 42bf5ff

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/prod.docs.plus.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,19 +237,24 @@ jobs:
237237
echo "DEPLOY_TAG=${{ env.DEPLOY_TAG }}" >> "${{ env.ENV_FILE }}"
238238
echo "✅ Environment ready"
239239
240+
- name: 🧹 Clear Stale Docker Cache
241+
run: |
242+
echo "🧹 Clearing Docker builder cache..."
243+
docker builder prune -f 2>/dev/null || true
244+
echo "✅ Cache cleared"
245+
240246
- name: 🏗️ Build Docker Images
241247
env:
242248
DOCKER_BUILDKIT: 1
243249
COMPOSE_DOCKER_CLI_BUILD: 1
244250
run: |
245251
echo "🔨 Building images with tag: ${{ env.DEPLOY_TAG }}"
246-
echo "🚀 BuildKit enabled for faster cached builds"
247252
248253
set -a
249254
source ${{ env.ENV_FILE }}
250255
set +a
251256
252-
# Build with BuildKit and parallel execution
257+
# Build with parallel execution
253258
docker compose -f ${{ env.COMPOSE_FILE }} \
254259
--env-file ${{ env.ENV_FILE }} \
255260
build --parallel

.github/workflows/stage.docs.plus.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,17 @@ jobs:
209209
echo "DEPLOY_TAG=${{ env.DEPLOY_TAG }}" >> "${{ env.ENV_FILE }}"
210210
echo "✅ Environment prepared"
211211
212+
- name: 🧹 Clear Stale Docker Cache
213+
run: |
214+
echo "🧹 Clearing Docker builder cache..."
215+
docker builder prune -f 2>/dev/null || true
216+
echo "✅ Cache cleared"
217+
212218
- name: 🏗️ Build Docker Images
213219
env:
214220
DOCKER_BUILDKIT: 1
215221
COMPOSE_DOCKER_CLI_BUILD: 1
216222
run: |
217-
echo "🚀 BuildKit enabled for faster cached builds"
218-
219223
set -a
220224
source ${{ env.ENV_FILE }}
221225
set +a

0 commit comments

Comments
 (0)