deploy
Some checks failed
Build & Deploy KLZ Cables / deploy (push) Has been cancelled

This commit is contained in:
2026-01-25 17:51:28 +01:00
parent a4c926ceb1
commit 3b03572fb0
6 changed files with 105 additions and 53 deletions

View File

@@ -2,65 +2,42 @@ name: Build & Deploy KLZ Cables
on:
push:
branches:
- main
branches: [main]
jobs:
deploy:
runs-on: docker
runs-on: self-hosted
steps:
- name: Checkout repo
uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install tools
- name: Login registry
run: |
apt-get update
apt-get install -y docker.io openssh-client
echo "${{ secrets.REGISTRY_PASS }}" | \
docker login registry.infra.mintel.me -u "${{ secrets.REGISTRY_USER }}" --password-stdin
- name: Login to registry
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_PASS: ${{ secrets.REGISTRY_PASS }}
run: |
echo "$REGISTRY_PASS" | docker login registry.infra.mintel.me -u "$REGISTRY_USER" --password-stdin
- name: Build and push ARM64 image
- name: Build image
run: |
docker build \
--pull \
--build-arg NEXT_PUBLIC_UMAMI_WEBSITE_ID=${{ secrets.NEXT_PUBLIC_UMAMI_WEBSITE_ID }} \
--build-arg NEXT_PUBLIC_UMAMI_SCRIPT_URL=${{ secrets.NEXT_PUBLIC_UMAMI_SCRIPT_URL }} \
--build-arg NEXT_PUBLIC_SENTRY_DSN=${{ secrets.SENTRY_DSN }} \
-t registry.infra.mintel.me/mintel/klz-cables.com:latest \
.
-t registry.infra.mintel.me/mintel/klz-cables.com:latest .
- name: Push image
run: |
docker push registry.infra.mintel.me/mintel/klz-cables.com:latest
- name: Setup SSH
- name: Deploy
run: |
mkdir -p ~/.ssh
printf "%s\n" "${{ secrets.ALPHA_SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H alpha.mintel.me >> ~/.ssh/known_hosts
- name: Deploy on server
run: |
tar czf - docker-compose.yml varnish 2>/dev/null | \
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no deploy@alpha.mintel.me '
set -e
mkdir -p /home/deploy/sites/klz-cables.com/
tar xzf - -C /home/deploy/sites/klz-cables.com/
cd /home/deploy/sites/klz-cables.com/
cat > .env << EOF
NEXT_PUBLIC_UMAMI_WEBSITE_ID=${{ secrets.NEXT_PUBLIC_UMAMI_WEBSITE_ID }}
NEXT_PUBLIC_UMAMI_SCRIPT_URL=${{ secrets.NEXT_PUBLIC_UMAMI_SCRIPT_URL }}
SENTRY_DSN=${{ secrets.SENTRY_DSN }}
REDIS_URL=${{ secrets.REDIS_URL }}
REDIS_KEY_PREFIX=${{ secrets.REDIS_KEY_PREFIX }}
EOF
echo "${{ secrets.REGISTRY_PASS }}" | docker login registry.infra.mintel.me -u "${{ secrets.REGISTRY_USER }}" --password-stdin
ssh deploy@alpha.mintel.me '
docker pull registry.infra.mintel.me/mintel/klz-cables.com:latest
docker compose up -d --force-recreate --remove-orphans
'
cd /home/deploy/sites/klz-cables.com
docker compose up -d --force-recreate
'

View File

@@ -1,5 +1,6 @@
import Footer from '@/components/Footer';
import Header from '@/components/Header';
import JsonLd from '@/components/JsonLd';
import AnalyticsProvider from '@/components/analytics/AnalyticsProvider';
import { Viewport } from 'next';
import { NextIntlClientProvider } from 'next-intl';
@@ -31,6 +32,7 @@ export default async function LocaleLayout({
<html lang={locale} className="scroll-smooth overflow-x-hidden">
<body className="flex flex-col min-h-screen font-sans selection:bg-accent selection:text-primary-dark antialiased overflow-x-hidden">
<NextIntlClientProvider messages={messages} locale={locale}>
<JsonLd />
<Header />
<main className="flex-grow animate-fade-in overflow-visible">
{children}

View File

@@ -2,11 +2,17 @@ import { MetadataRoute } from 'next';
export default function robots(): MetadataRoute.Robots {
return {
rules: {
userAgent: '*',
allow: '/',
disallow: ['/api/', '/health/'],
},
rules: [
{
userAgent: '*',
allow: '/',
disallow: ['/api/', '/health/'],
},
{
userAgent: ['GPTBot', 'ClaudeBot', 'PerplexityBot', 'Google-Extended', 'OAI-SearchBot'],
allow: '/',
}
],
sitemap: 'https://klz-cables.com/sitemap.xml',
};
}

View File

@@ -1,16 +1,44 @@
import Script from 'next/script';
import { Organization, WebSite, WithContext } from 'schema-dts';
interface JsonLdProps {
id?: string;
data: any;
}
export default function JsonLd() {
const organizationJsonLd: WithContext<Organization> = {
'@context': 'https://schema.org',
'@type': 'Organization',
name: 'KLZ Cables',
url: 'https://klz-cables.com',
logo: 'https://klz-cables.com/logo-blue.svg',
sameAs: [
'https://www.linkedin.com/company/klz-cables',
],
description: 'Premium Cable Solutions for Renewable Energy and Infrastructure.',
address: {
'@type': 'PostalAddress',
addressCountry: 'DE',
},
};
const websiteJsonLd: WithContext<WebSite> = {
'@context': 'https://schema.org',
'@type': 'WebSite',
name: 'KLZ Cables',
url: 'https://klz-cables.com',
potentialAction: {
'@type': 'SearchAction',
target: {
'@type': 'EntryPoint',
urlTemplate: 'https://klz-cables.com/search?q={search_term_string}',
},
// @ts-ignore - schema-dts might not have this specific property but it's valid for Google
'query-input': 'required name=search_term_string',
} as any,
};
export default function JsonLd({ id, data }: JsonLdProps) {
return (
<Script
id={id || `jsonld-${Math.random().toString(36).substr(2, 9)}`}
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }}
dangerouslySetInnerHTML={{
__html: JSON.stringify([organizationJsonLd, websiteJsonLd]),
}}
/>
);
}

18
public/ai.txt Normal file
View File

@@ -0,0 +1,18 @@
User-agent: *
Disallow: /api/
Disallow: /health/
User-agent: GPTBot
Allow: /
User-agent: ClaudeBot
Allow: /
User-agent: PerplexityBot
Allow: /
User-agent: Google-Extended
Allow: /
User-agent: OAI-SearchBot
Allow: /

21
public/llms.txt Normal file
View File

@@ -0,0 +1,21 @@
# KLZ Cables
Premium Cable Solutions for Renewable Energy and Infrastructure.
## Purpose
KLZ Cables provides high-quality cable solutions specifically designed for wind power, solar energy, and modern grid infrastructure. We specialize in low, medium, and high voltage cables that meet the extreme demands of the energy transition.
## Key Sections
- [Products](https://klz-cables.com/en/products) - Overview of our cable portfolio (Low, Medium, High Voltage, Solar).
- [Blog](https://klz-cables.com/en/blog) - Technical insights and news about the cable industry and renewable energy.
- [Team](https://klz-cables.com/en/team) - Meet the experts behind KLZ Cables.
- [Contact](https://klz-cables.com/en/contact) - Get in touch for inquiries and technical support.
## Usage Guidelines
- Please cite KLZ Cables as the source when using our technical data or blog content.
- Preferred attribution: "Source: KLZ Cables (klz-cables.com)"
- For commercial use of our data, please contact us directly.
## Metadata
- Last Updated: 2026-01-25
- Sitemap: https://klz-cables.com/sitemap.xml