build: include .next/cache in Docker build context.
All checks were successful
Build & Deploy KLZ Cables / 🔍 Prepare Environment (push) Successful in 21s
Build & Deploy KLZ Cables / 🧪 Quality Assurance (push) Successful in 1m22s
Build & Deploy KLZ Cables / 🏗️ Build & Push (push) Successful in 5m42s
Build & Deploy KLZ Cables / 🚀 Deploy (push) Successful in 44s
Build & Deploy KLZ Cables / 🔔 Notifications (push) Successful in 2s

This commit is contained in:
2026-02-01 13:43:42 +01:00
parent ea3076b4ec
commit 77a1067820
2 changed files with 32 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
node_modules
.next
!.next/cache
.git
.DS_Store
.env

View File

@@ -9,10 +9,9 @@ on:
workflow_dispatch:
inputs:
skip_long_checks:
description: 'Lange Tests / Scans überspringen? (Hotfix / Eilt!)'
description: 'Skip tests? (true/false)'
required: false
type: boolean
default: false
default: 'false'
concurrency:
group: ${{ github.workflow }}
@@ -137,22 +136,27 @@ jobs:
- name: Install dependencies
run: npm ci
- name: 🔍 Lint & Typecheck
- name: 🧪 Run Checks in Parallel
if: github.event.inputs.skip_long_checks != 'true'
run: |
npm run lint
npm run typecheck
npm run lint &
LINT_PID=$!
npm run typecheck &
TYPE_PID=$!
npm run test &
TEST_PID=$!
- name: 🧪 Test
if: github.event.inputs.skip_long_checks != 'true'
run: npm run test
# Wait for all and fail if any fail
wait $LINT_PID || exit 1
wait $TYPE_PID || exit 1
wait $TEST_PID || exit 1
# ──────────────────────────────────────────────────────────────────────────────
# JOB 3: Build & Push Docker Image
# ──────────────────────────────────────────────────────────────────────────────
build:
name: 🏗️ Build & Push
needs: [prepare, qa]
needs: prepare
runs-on: docker
steps:
- name: Checkout repository
@@ -162,6 +166,15 @@ jobs:
run: |
echo "${{ secrets.REGISTRY_PASS }}" | docker login registry.infra.mintel.me -u "${{ secrets.REGISTRY_USER }}" --password-stdin
- name: 📦 Restore Next.js cache
uses: actions/cache@v4
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
${{ runner.os }}-nextjs-
- name: 🏗️ Docker Image bauen & pushen
env:
IMAGE_TAG: ${{ needs.prepare.outputs.image_tag }}
@@ -184,12 +197,19 @@ jobs:
--cache-to type=registry,ref=registry.infra.mintel.me/mintel/klz-cables.com:buildcache,mode=max \
--push .
- name: 📦 Save Next.js cache
uses: actions/cache/save@v4
if: always()
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# ──────────────────────────────────────────────────────────────────────────────
# JOB 4: Deploy via SSH
# ──────────────────────────────────────────────────────────────────────────────
deploy:
name: 🚀 Deploy
needs: [prepare, build]
needs: [prepare, build, qa]
runs-on: docker
env:
TARGET: ${{ needs.prepare.outputs.target }}