Compare commits
8 Commits
v1.2.11-rc
...
v1.2.14
| Author | SHA1 | Date | |
|---|---|---|---|
| b1859c15ce | |||
| 6085cc05dc | |||
| bcf2d60da6 | |||
| f4fdb89ba4 | |||
| 9de3931e33 | |||
| b10dbcb23f | |||
| 65bb9c620a | |||
| 63853ffa89 |
@@ -50,12 +50,15 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .turbo
|
||||
key: ${{ runner.os }}-turbo-${{ github.sha }}
|
||||
key: ${{ runner.os }}-turbo-global-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-turbo-global-
|
||||
${{ 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
|
||||
|
||||
@@ -175,15 +175,18 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .turbo
|
||||
key: ${{ runner.os }}-turbo-${{ github.sha }}
|
||||
key: ${{ runner.os }}-turbo-global-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-turbo-global-
|
||||
${{ 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
|
||||
@@ -389,7 +392,7 @@ jobs:
|
||||
name: 🧪 Smoke Test
|
||||
needs: [prepare, deploy]
|
||||
continue-on-error: true
|
||||
if: needs.deploy.result == 'success'
|
||||
if: needs.deploy.result == 'success' && github.ref_type != 'tag'
|
||||
runs-on: docker
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
@@ -422,7 +425,7 @@ jobs:
|
||||
name: ⚡ Lighthouse
|
||||
needs: [prepare, deploy]
|
||||
continue-on-error: true
|
||||
if: success() && needs.prepare.outputs.target != 'skip'
|
||||
if: success() && needs.prepare.outputs.target != 'skip' && github.ref_type != 'tag'
|
||||
runs-on: docker
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
@@ -497,7 +500,7 @@ jobs:
|
||||
name: ♿ WCAG
|
||||
needs: [prepare, deploy, smoke_test]
|
||||
continue-on-error: true
|
||||
if: success() && needs.prepare.outputs.target != 'skip'
|
||||
if: success() && needs.prepare.outputs.target != 'skip' && github.ref_type != 'tag'
|
||||
runs-on: docker
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
@@ -579,7 +582,7 @@ jobs:
|
||||
name: 🛡️ Quality Gates
|
||||
needs: [prepare, deploy, smoke_test]
|
||||
continue-on-error: true
|
||||
if: success() && needs.prepare.outputs.target != 'skip'
|
||||
if: success() && needs.prepare.outputs.target != 'skip' && github.ref_type != 'tag'
|
||||
runs-on: docker
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
|
||||
@@ -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*',
|
||||
],
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@import 'tailwindcss';
|
||||
@config "../tailwind.config.cjs";
|
||||
|
||||
@theme {
|
||||
--font-sans:
|
||||
@@ -46,6 +47,18 @@
|
||||
--animate-slight-fade-in-from-bottom: slight-fade-in-from-bottom 0.8s
|
||||
cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
||||
--animate-gradient-x: gradient-x 15s ease infinite;
|
||||
--animate-draw-stroke: draw-stroke 1.8s ease-in-out 0.5s forwards;
|
||||
|
||||
@keyframes draw-stroke {
|
||||
from {
|
||||
stroke-dasharray: 1;
|
||||
stroke-dashoffset: 1;
|
||||
}
|
||||
to {
|
||||
stroke-dasharray: 1;
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes gradient-x {
|
||||
0%,
|
||||
|
||||
32
turbo.json
32
turbo.json
@@ -1,19 +1,51 @@
|
||||
{
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"globalDependencies": [
|
||||
"pnpm-lock.yaml",
|
||||
".gitea/workflows/ci.yml",
|
||||
".gitea/workflows/deploy.yml"
|
||||
],
|
||||
"tasks": {
|
||||
"lint": {
|
||||
"inputs": [
|
||||
"app/**/*.tsx",
|
||||
"app/**/*.ts",
|
||||
"components/**/*.tsx",
|
||||
"components/**/*.ts",
|
||||
"lib/**/*.ts",
|
||||
"eslint.config.mjs"
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
"typecheck": {
|
||||
"inputs": [
|
||||
"app/**/*.tsx",
|
||||
"app/**/*.ts",
|
||||
"components/**/*.tsx",
|
||||
"components/**/*.ts",
|
||||
"lib/**/*.ts",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
"test": {
|
||||
"inputs": [
|
||||
"app/**/*.tsx",
|
||||
"app/**/*.ts",
|
||||
"components/**/*.tsx",
|
||||
"components/**/*.ts",
|
||||
"lib/**/*.ts",
|
||||
"tests/**/*.ts",
|
||||
"vitest.config.mts"
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
"check:spell": {
|
||||
"inputs": ["content/**/*.{md,mdx}", "app/**/*.tsx", "components/**/*.tsx", "cspell.json"],
|
||||
"outputs": []
|
||||
},
|
||||
"check:mdx": {
|
||||
"inputs": ["content/**/*.{md,mdx}", "scripts/validate-mdx.mjs"],
|
||||
"outputs": []
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user