Compare commits

..

4 Commits

Author SHA1 Message Date
9de3931e33 feat: Implement imgproxy health check with fallback redirection for image requests when the service is down.
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 1m12s
Build & Deploy / 🧪 QA (push) Successful in 1m56s
Build & Deploy / 🚀 Deploy (push) Blocked by required conditions
Build & Deploy / 🧪 Smoke Test (push) Blocked by required conditions
Build & Deploy / ⚡ Lighthouse (push) Blocked by required conditions
Build & Deploy / ♿ WCAG (push) Blocked by required conditions
Build & Deploy / 🛡️ Quality Gates (push) Blocked by required conditions
Build & Deploy / 🔔 Notify (push) Blocked by required conditions
Build & Deploy / 🏗️ Build (push) Has been cancelled
2026-02-23 02:35:49 +01:00
b10dbcb23f fix(ci): Persist Next.js BuildKit cache mount to runner stage
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 15s
Build & Deploy / 🧪 QA (push) Successful in 9m12s
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / ♿ WCAG (push) Has been cancelled
Build & Deploy / 🛡️ Quality Gates (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🏗️ Build (push) Has started running
2026-02-23 02:26:41 +01:00
65bb9c620a chore(ci): Fix TURBO_TELEMETRY_DISABLED variable type
Some checks failed
Build & Deploy / 🔍 Prepare (push) Has started running
Build & Deploy / 🧪 QA (push) Has been cancelled
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / ♿ WCAG (push) Has been cancelled
Build & Deploy / 🛡️ Quality Gates (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
2026-02-23 02:25:49 +01:00
63853ffa89 chore(ci): Optimize Turborepo cache restoring and add Next.js BuildKit caching
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 29s
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / ♿ WCAG (push) Has been cancelled
Build & Deploy / 🛡️ Quality Gates (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🧪 QA (push) Successful in 1m45s
Build & Deploy / 🏗️ Build (push) Has been cancelled
2026-02-23 02:17:31 +01:00
5 changed files with 48 additions and 9 deletions

View File

@@ -50,12 +50,15 @@ jobs:
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
key: ${{ runner.os }}-turbo-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-${{ github.ref_name }}-
${{ runner.os }}-turbo-
- name: 🧪 QA Checks
run: npx turbo run check:mdx lint typecheck test
env:
TURBO_TELEMETRY_DISABLED: "1"
run: npx turbo run check:mdx lint typecheck test --cache-dir=".turbo"
- name: 🏗️ Build
run: pnpm build

View File

@@ -175,15 +175,18 @@ jobs:
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
key: ${{ runner.os }}-turbo-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-${{ github.ref_name }}-
${{ runner.os }}-turbo-
- name: 🔒 Security Audit
run: pnpm audit --audit-level high
- name: 🧪 QA Checks
if: github.event.inputs.skip_checks != 'true'
run: npx turbo run lint check:spell typecheck test
env:
TURBO_TELEMETRY_DISABLED: "1"
run: npx turbo run lint check:spell typecheck test --cache-dir=".turbo"
# ──────────────────────────────────────────────────────────────────────────────
# JOB 3: Build & Push
@@ -209,6 +212,8 @@ jobs:
push: true
provenance: false
platforms: linux/arm64
cache-from: type=gha,scope=nextjs-build-${{ needs.prepare.outputs.target }}
cache-to: type=gha,mode=max,scope=nextjs-build-${{ needs.prepare.outputs.target }}
build-args: |
NEXT_PUBLIC_BASE_URL=${{ needs.prepare.outputs.next_public_url }}
NEXT_PUBLIC_TARGET=${{ needs.prepare.outputs.target }}

View File

@@ -41,7 +41,10 @@ CMD ["pnpm", "dev:local"]
# Build application
# Stage 3: Builder (Production)
FROM base AS builder
RUN pnpm build
RUN --mount=type=cache,target=/app/.next/cache,id=nextjs-cache \
pnpm build && \
mkdir -p /app/.next-cache-tmp && \
cp -r /app/.next/cache/* /app/.next-cache-tmp/ || true
# Stage 3: Runner
FROM registry.infra.mintel.me/mintel/runtime:v1.7.10 AS runner
@@ -60,6 +63,6 @@ ENV NODE_ENV=production
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/.next/cache ./.next/cache
COPY --from=builder --chown=nextjs:nodejs /app/.next-cache-tmp ./.next/cache
CMD ["node", "server.js"]

View File

@@ -10,10 +10,38 @@ const intlMiddleware = createMiddleware({
defaultLocale: 'en',
});
export default function middleware(request: NextRequest) {
const imgproxyStatus = { isDown: false, lastCheck: 0 };
async function isImgproxyDown() {
const now = Date.now();
if (now - imgproxyStatus.lastCheck > 60000) {
try {
const imgproxyUrl = process.env.IMGPROXY_URL || 'https://img.infra.mintel.me';
const checkUrl = imgproxyUrl.startsWith('http') ? imgproxyUrl : `https://${imgproxyUrl}`;
const res = await fetch(checkUrl, { signal: AbortSignal.timeout(2000) });
imgproxyStatus.isDown = res.status >= 500;
} catch (e) {
imgproxyStatus.isDown = true;
}
imgproxyStatus.lastCheck = now;
}
return imgproxyStatus.isDown;
}
export default async function middleware(request: NextRequest) {
const { method, url, headers } = request;
const { pathname } = request.nextUrl;
if (pathname.startsWith('/_img/')) {
if (await isImgproxyDown()) {
const originalUrl = request.nextUrl.searchParams.get('url');
if (originalUrl) {
return NextResponse.redirect(originalUrl);
}
}
return NextResponse.next();
}
// Explicit bypass for infrastructure routes to avoid locale redirects/interception
if (
pathname.startsWith('/stats') ||
@@ -97,7 +125,7 @@ export default function middleware(request: NextRequest) {
export const config = {
matcher: [
'/((?!api|_next/static|_next/image|_img|favicon.ico|manifest.webmanifest|.*\\.(?:svg|png|jpg|jpeg|gif|webp|pdf|txt|vcf|xml|webm|mp4|map)$).*)',
'/((?!api|_next/static|_next/image|favicon.ico|manifest.webmanifest|.*\\.(?:svg|png|jpg|jpeg|gif|webp|pdf|txt|vcf|xml|webm|mp4|map)$).*)',
'/(de|en)/:path*',
'/(de|en)/:path*',
],

View File

@@ -126,7 +126,7 @@
"prepare": "husky",
"preinstall": "npx only-allow pnpm"
},
"version": "1.0.0",
"version": "1.0.1-rc.0",
"pnpm": {
"overrides": {
"next": "16.1.6",