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
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:
@@ -1,5 +1,6 @@
|
|||||||
node_modules
|
node_modules
|
||||||
.next
|
.next
|
||||||
|
!.next/cache
|
||||||
.git
|
.git
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.env
|
.env
|
||||||
|
|||||||
@@ -9,10 +9,9 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
skip_long_checks:
|
skip_long_checks:
|
||||||
description: 'Lange Tests / Scans überspringen? (Hotfix / Eilt!)'
|
description: 'Skip tests? (true/false)'
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
default: 'false'
|
||||||
default: false
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}
|
group: ${{ github.workflow }}
|
||||||
@@ -137,22 +136,27 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: 🔍 Lint & Typecheck
|
- name: 🧪 Run Checks in Parallel
|
||||||
if: github.event.inputs.skip_long_checks != 'true'
|
if: github.event.inputs.skip_long_checks != 'true'
|
||||||
run: |
|
run: |
|
||||||
npm run lint
|
npm run lint &
|
||||||
npm run typecheck
|
LINT_PID=$!
|
||||||
|
npm run typecheck &
|
||||||
|
TYPE_PID=$!
|
||||||
|
npm run test &
|
||||||
|
TEST_PID=$!
|
||||||
|
|
||||||
- name: 🧪 Test
|
# Wait for all and fail if any fail
|
||||||
if: github.event.inputs.skip_long_checks != 'true'
|
wait $LINT_PID || exit 1
|
||||||
run: npm run test
|
wait $TYPE_PID || exit 1
|
||||||
|
wait $TEST_PID || exit 1
|
||||||
|
|
||||||
# ──────────────────────────────────────────────────────────────────────────────
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
# JOB 3: Build & Push Docker Image
|
# JOB 3: Build & Push Docker Image
|
||||||
# ──────────────────────────────────────────────────────────────────────────────
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
build:
|
build:
|
||||||
name: 🏗️ Build & Push
|
name: 🏗️ Build & Push
|
||||||
needs: [prepare, qa]
|
needs: prepare
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -162,6 +166,15 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.REGISTRY_PASS }}" | docker login registry.infra.mintel.me -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
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
|
- name: 🏗️ Docker Image bauen & pushen
|
||||||
env:
|
env:
|
||||||
IMAGE_TAG: ${{ needs.prepare.outputs.image_tag }}
|
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 \
|
--cache-to type=registry,ref=registry.infra.mintel.me/mintel/klz-cables.com:buildcache,mode=max \
|
||||||
--push .
|
--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
|
# JOB 4: Deploy via SSH
|
||||||
# ──────────────────────────────────────────────────────────────────────────────
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
deploy:
|
deploy:
|
||||||
name: 🚀 Deploy
|
name: 🚀 Deploy
|
||||||
needs: [prepare, build]
|
needs: [prepare, build, qa]
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
env:
|
env:
|
||||||
TARGET: ${{ needs.prepare.outputs.target }}
|
TARGET: ${{ needs.prepare.outputs.target }}
|
||||||
|
|||||||
Reference in New Issue
Block a user