From 1988c635fed3e74e80300f7519ca0d224295786f Mon Sep 17 00:00:00 2001 From: "Tom Chien (IQ-AS)" Date: Wed, 18 Nov 2026 14:26:36 +0800 Subject: [PATCH] upload --- .dockerignore | 15 + .gitea/workflows/cicd.yaml | 209 + .gitignore | 44 + AGENTS.md | 9 + Dockerfile | 34 + app/favicon.ico | Bin 0 -> 15086 bytes app/globals.css | 107 + app/layout.tsx | 17 + app/page.tsx | 66 + components/BrandIcon.tsx | 23 + components/CredentialRows.tsx | 18 + components/Header.tsx | 44 + components/Introduction.tsx | 24 + components/Section.tsx | 30 + components/Travel.tsx | 93 + components/flow.tsx | 121 + components/lab/CicdFlow.tsx | 139 + components/lab/RequestFlow.tsx | 154 + components/lab/ServiceLinks.tsx | 66 + components/lab/StackBadges.tsx | 39 + content/site.ts | 62 + eslint.config.mjs | 18 + helm/Chart.yaml | 6 + helm/templates/_helpers.tpl | 28 + helm/templates/deployment.yaml | 57 + helm/templates/ingress.yaml | 25 + helm/templates/service.yaml | 15 + helm/values-dev.yaml | 4 + helm/values-prod.yaml | 6 + helm/values.yaml | 33 + next.config.ts | 18 + package-lock.json | 6828 +++++++++++++++++++++++++++++++ package.json | 28 + tsconfig.json | 34 + 34 files changed, 8414 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitea/workflows/cicd.yaml create mode 100644 .gitignore create mode 100644 AGENTS.md create mode 100644 Dockerfile create mode 100644 app/favicon.ico create mode 100644 app/globals.css create mode 100644 app/layout.tsx create mode 100644 app/page.tsx create mode 100644 components/BrandIcon.tsx create mode 100644 components/CredentialRows.tsx create mode 100644 components/Header.tsx create mode 100644 components/Introduction.tsx create mode 100644 components/Section.tsx create mode 100644 components/Travel.tsx create mode 100644 components/flow.tsx create mode 100644 components/lab/CicdFlow.tsx create mode 100644 components/lab/RequestFlow.tsx create mode 100644 components/lab/ServiceLinks.tsx create mode 100644 components/lab/StackBadges.tsx create mode 100644 content/site.ts create mode 100644 eslint.config.mjs create mode 100644 helm/Chart.yaml create mode 100644 helm/templates/_helpers.tpl create mode 100644 helm/templates/deployment.yaml create mode 100644 helm/templates/ingress.yaml create mode 100644 helm/templates/service.yaml create mode 100644 helm/values-dev.yaml create mode 100644 helm/values-prod.yaml create mode 100644 helm/values.yaml create mode 100644 next.config.ts create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 tsconfig.json diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..516041f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +node_modules +.next +out +.git +.gitea +.claude +.vscode +helm +Dockerfile +.dockerignore +README.md +AGENTS.md +npm-debug.log* +*.tsbuildinfo +.env* diff --git a/.gitea/workflows/cicd.yaml b/.gitea/workflows/cicd.yaml new file mode 100644 index 0000000..840e41d --- /dev/null +++ b/.gitea/workflows/cicd.yaml @@ -0,0 +1,209 @@ +name: CI/CD (dev on branch, prod on tag) + +on: + push: + branches: + - dev # build & deploy for dev only + tags: + - "*" # build & deploy for prod only when a tag is pushed + +jobs: + build-and-deploy: + # Gitea Actions: runners are selected by label only (no runner groups). + runs-on: ubuntu-latest + + # Per-environment group: a dev push must never cancel an in-flight prod + # deploy. NOTE: act_runner does not support dynamic matrix (fromJSON of a + # job output expands every matrix.* to ""), so per-env config is computed + # in the "Resolve environment config" bash step below instead. + concurrency: + group: deploy-${{ github.ref_type == 'tag' && 'prod' || 'dev' }} + cancel-in-progress: true + + env: + # Harbor on the Mac mini host. The runner pod mounts the Docker Desktop + # daemon socket, so from the daemon's point of view the registry is + # reachable as host.docker.internal:8080 (plain HTTP — the daemon must + # list it under "insecure-registries"). Images live in Harbor's + # "library" project. + REGISTRY: host.docker.internal:8080/library + DOCKER_BUILDKIT: "1" + COMPOSE_DOCKER_CLI_BUILD: "1" + + steps: + - name: Checkout (with tags) + uses: actions/checkout@v4 + with: + fetch-depth: 0 # IMPORTANT to access tags + + # Replaces the former setup job + dynamic matrix (unsupported on + # act_runner). Everything derived from the ref type lands in GITHUB_ENV + # so later steps can use plain $VARS. + - name: Resolve environment config + shell: bash + run: | + if [[ "${{ github.ref_type }}" == "tag" ]]; then + DEPLOY_ENV=prod + RELEASE_TAG="${GITHUB_REF#refs/tags/}" + else + DEPLOY_ENV=dev + RELEASE_TAG="" + fi + { + echo "DEPLOY_ENV=${DEPLOY_ENV}" + echo "RELEASE_TAG=${RELEASE_TAG}" + echo "IMAGE=${REGISTRY}/portal-${DEPLOY_ENV}" + echo "LATEST_TAG=latest-${DEPLOY_ENV}" + echo "RELEASE=portal-${DEPLOY_ENV}" + echo "NAMESPACE=portal-${DEPLOY_ENV}" + echo "CHART=./helm" + echo "VALUES_FILE=./helm/values-${DEPLOY_ENV}.yaml" + } >> "$GITHUB_ENV" + + echo "Resolved environment: ${DEPLOY_ENV} (release tag: '${RELEASE_TAG}')" + + - name: Verify tag is on prod branch (main) + if: github.ref_type == 'tag' + shell: bash + run: | + git fetch origin main --quiet + if git merge-base --is-ancestor "${{ github.sha }}" origin/main; then + echo "Tag commit is on main. Proceeding with prod deploy." + else + echo "::error::Tag ${GITHUB_REF#refs/tags/} points at a commit not on main. Refusing prod deploy." + exit 1 + fi + + # The runner's job image ships docker but not kubectl/helm, so install + # them at job start (static binaries, linux/amd64). + - name: Install kubectl & helm + run: | + if ! command -v kubectl >/dev/null 2>&1; then + KVER=$(curl -sfL https://dl.k8s.io/release/stable.txt) + curl -sfL -o /usr/local/bin/kubectl "https://dl.k8s.io/release/${KVER}/bin/linux/amd64/kubectl" + chmod +x /usr/local/bin/kubectl + fi + if ! command -v helm >/dev/null 2>&1; then + curl -sfL https://get.helm.sh/helm-v3.16.4-linux-amd64.tar.gz | tar xz -C /tmp + mv /tmp/linux-amd64/helm /usr/local/bin/helm + fi + kubectl version --client + helm version + + # Fail fast on chart/template errors before spending time on a build. + - name: Lint Helm chart + run: | + helm lint "${CHART}" -f "${VALUES_FILE}" + + - name: Set up kubeconfig + run: | + echo "KUBECONFIG=${RUNNER_TEMP}/kubeconfig" >> "$GITHUB_ENV" + echo "${{ secrets.KUBE_CONFIG_DATA }}" | base64 -d > "${RUNNER_TEMP}/kubeconfig" + chmod 600 "${RUNNER_TEMP}/kubeconfig" + + - name: Login to Harbor + run: | + # REGISTRY is host/project but `docker login` takes only the host. + REGISTRY_HOST=$(echo "${REGISTRY}" | cut -d'/' -f1) + echo "Logging in to ${REGISTRY_HOST}" + echo "${{ secrets.HARBOR_PASSWORD }}" | docker login "${REGISTRY_HOST}" \ + -u "${{ secrets.HARBOR_USERNAME }}" \ + --password-stdin + + - name: Pre-build diagnostics + run: | + echo "Ref: ${GITHUB_REF}" + echo "Environment: ${DEPLOY_ENV}" + echo "Release tag: ${RELEASE_TAG}" + echo "Image: ${IMAGE}" + docker version + helm version + kubectl version --client + + - name: Build & Push image + run: | + BUILD_TAG_ARGS=( + -t "${IMAGE}:${LATEST_TAG}" + -t "${IMAGE}:${{ github.sha }}" + ) + if [[ -n "${RELEASE_TAG}" ]]; then + BUILD_TAG_ARGS+=( -t "${IMAGE}:${RELEASE_TAG}" ) + fi + + docker build \ + -f Dockerfile \ + "${BUILD_TAG_ARGS[@]}" \ + . + + docker push "${IMAGE}:${LATEST_TAG}" + docker push "${IMAGE}:${{ github.sha }}" + if [[ -n "${RELEASE_TAG}" ]]; then + docker push "${IMAGE}:${RELEASE_TAG}" + fi + + - name: Ensure namespace exists + run: | + # `helm --atomic` against a missing namespace fails outright. + kubectl create namespace "${NAMESPACE}" \ + --dry-run=client -o yaml | kubectl apply -f - + + # The kubelet pulls through the same Docker Desktop daemon that built the + # image, so the pull server must match the push host exactly + # (host.docker.internal:8080). + - name: Ensure Harbor pull secret exists + run: | + kubectl create secret docker-registry harbor-pull-secret \ + --docker-server="$(echo "${REGISTRY}" | cut -d'/' -f1)" \ + --docker-username="${{ secrets.HARBOR_USERNAME }}" \ + --docker-password="${{ secrets.HARBOR_PASSWORD }}" \ + --namespace "${NAMESPACE}" \ + --dry-run=client -o yaml | kubectl apply -f - + + # ---- DEV DEPLOY (branch dev only) ---- + # Deployed by commit SHA, not latest-dev: an immutable tag sidesteps the + # moving-tag + IfNotPresent stale-cache trap and makes `kubectl describe + # pod` show exactly which commit is live. + - name: Deploy DEV with Helm + if: github.ref_type == 'branch' && github.ref == 'refs/heads/dev' + run: | + kubectl get nodes + kubectl get ns + + helm upgrade --install "${RELEASE}" "${CHART}" \ + -f "${VALUES_FILE}" \ + --namespace "${NAMESPACE}" \ + --set server.image.repository="${IMAGE}" \ + --set server.image.tag="${{ github.sha }}" \ + --wait --timeout 10m --atomic --debug + + # ---- PROD DEPLOY (tag push only) ---- + - name: Deploy PROD with Helm + if: github.ref_type == 'tag' + run: | + kubectl get nodes + kubectl get ns + + if [[ -z "${RELEASE_TAG}" ]]; then + echo "No tag detected; aborting prod deploy." + exit 1 + fi + + helm upgrade --install "${RELEASE}" "${CHART}" \ + -f "${VALUES_FILE}" \ + --namespace "${NAMESPACE}" \ + --set server.image.repository="${IMAGE}" \ + --set server.image.tag="${RELEASE_TAG}" \ + --wait --timeout 10m --atomic --debug + + - name: Post-deploy diagnostics (if failure) + if: failure() + run: | + echo "----- Diagnostics -----" + kubectl get deploy,po,svc,ing -n "${NAMESPACE}" -o wide || true + echo "----- Events -----" + kubectl get events -n "${NAMESPACE}" --sort-by=.lastTimestamp || true + for p in $(kubectl get po -n "${NAMESPACE}" -o name); do + echo "### $p" + kubectl describe "$p" -n "${NAMESPACE}" || true + kubectl logs "$p" -n "${NAMESPACE}" --all-containers --tail=200 || true + done diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f93d687 --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files (can opt-in for committing if needed) +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts + +# local tooling +/.claude/ diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..af3b7c8 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,9 @@ + + +## This is NOT the Next.js you know + +This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices. + +This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean. + + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..02d98c4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +# syntax=docker/dockerfile:1 + +# ---- deps: install node_modules from the lockfile ---- +FROM node:24-alpine AS deps +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci + +# ---- builder: produce the standalone Next.js output ---- +FROM node:24-alpine AS builder +WORKDIR /app +ENV NEXT_TELEMETRY_DISABLED=1 +COPY --from=deps /app/node_modules ./node_modules +COPY . . +# public/ may be empty (git does not track empty dirs); the runner stage copies it. +RUN mkdir -p public && npm run build + +# ---- runner: minimal image with only what `node server.js` needs ---- +FROM node:24-alpine AS runner +WORKDIR /app +ENV NODE_ENV=production \ + NEXT_TELEMETRY_DISABLED=1 \ + PORT=3000 \ + HOSTNAME=0.0.0.0 + +RUN addgroup -S -g 1001 nodejs && adduser -S -u 1001 -G nodejs nextjs + +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/public ./public + +USER 1001 +EXPOSE 3000 +CMD ["node", "server.js"] diff --git a/app/favicon.ico b/app/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..af98450595e8b8efd9e505cddc5ed705b665a4d8 GIT binary patch literal 15086 zcmdU$XN*0PW5y#)gXL_h{3FkJ#X`oXpI?bB5#G)w~S7Qa+`W<1AB#X3C=?&UhvAO=|S+ zQpCR%R9`2h-z)7_x}fw(>6KDpfVd}*GI-!c2H9UDrKwS>=#NU@Ddj7@Q4*g7FEYrY z16}AW?v$zq+9+i!-B+T1{bG*9hmHqIUn`*-8^w`osM0?vVJi}rWb@IzKnYt#l~PpE zZq^t6O{HGFdQ!P^WzlxPHWGIHcd>D{}x={sTUg9&WW6602m zQnBH6>!yx}4jn2B7A%n2vuDesNt2{;dd zh7B@$^l0CFc@ZrPKrArsz@`@AQzbS#)CVarSbb!I8ty{PH zk}X}jv}9#v$)iV)Gb-#m>4qUO6)cT2PV3 zpI*Is$&Ww&XxZfC$&*s6RxM+zLWK&_s8J(BjQt6=fsGRsIez?@ix)2jvEROZTiUm8 zAGA}oYE|jjv7_)^<8Q|B8-jA4x_+h43HdwG`akQZ{rmR^u|IqEOoj~`7J{KpojS(< z>D#xjnZIoEL8L15HMT(z#WR80C=8eJ6m1l4LW@cu}s8OTj^Upsw@4?*W6SJES z?6iS9&)0pV`lp_$Z=3e*+h^9ZUK>rCG?5uIW|;4L`0(N0^@=YH0qjNg{kCh@PHx@0 zWueQ33l}2#^Q~LAHa;_LgYTK1p6(a3o6pAd+gv_56 zTeSG07MmF9|6)G^Q&#}`NMn_Um~~0isUI6)0h8ZU;`^Lf>f{vqND)`@P9?$9TK1fc;tCyQ6!+t!2dtUtke$_><;tw&q0@ECem?{wl!rS3|>b6OetkXT}@W?k_+rGrYh zl>Vi}m;6*0c#P>*l+@N$%>EBBFmQe{Fc#%OC9f_nmD)f~S=dohhj8vYl zv6`=x&=pVWsLX#+q8mig9W$TUxvt*}bzk7L-lNk`>Y+?Gm163T#zTyXvm=~)sb0N0 zaaweuJ6Zx`(zaEHG-%L3KK=Al6T>DZPhLQGq zy?Yqg@b-sP&7-d+WX~-}jDPy{>9TCuG9i8(A^wLgY}(XWZ-_f3WuJ2&?4j-5yH}Ph zSrTpU9$VNX@qMmWifEgC6yB+S|Ng&-_q*kY6P-PKR*oJ$D&4wui>NOkgH3F=P`Ve$ z3oFArk%&op&JP9oiCbR3eqHX}yJupw-hGKM`tJs8Gp0rz*J9ak*s!6TKY!j}B<@Qe z2xHHihfO=4d&@$equD1uh)vR!D_5jhvt}W(F>o+n#QfeP*=Ky4KYza26Uxue7xt`( zwGs1UFEoa2%CXJd6_q!V{lS9=%abQh(nAuU?8F#8U%^agA*f5vUU zO`A5Rzftd-H*XGp=j=}sgJvHomR>El^LJEU_xn@7oB=$3{5YoN^y$-PoVT`!UrwAj z(d>cRyeL=eJNUAXP0n?!TD8j9&dbY_&Ye4l$oA~n)9gP*+v9QJq3wP5KkQGLGDTj# zd};PI#*Q5uVjI0fh76HSn>LxVdoDY_;0u&tn{OaexyiTnfB*h{;fw|QLCcpf4;xpW zFkyme8_o^J(yQeMlzfjrrqcE2$dM!Fd_g$&SWBkEa^gaG!|Jt={ z=KFH#39++i(IT_Yx^(H%ko++GcKr1<|Ih~0rcI04uj!BQ`Z)V#=O2Y;=E9`s-!ShO zsSe!pFZPSf|L}>y>wkcu$o#Ju7{d8q*e4a4|Eapd)ji*PB>xlpq$2UZRgc#`wqyC< z*e8K8>Gg-|00V0nbj5maWeG|22l`3AlJ{NwJ|l|`ufMHXz7k^tYsg%g=)+?N8;M_9LtdS2KI3UcQZk+)cWFG|X4L^R?nKNgM zJp7#1#y{fx7Zcyn1ijH<*t+zGuIF{p8Z6OUCbF zJuqm{AfqFUdUSJ))2_z+s>OeFWelDY)Ji4$N2uccI^tDkzj4ezJD0s z6WNgVqu%*n4eJGq6%4dL{) { + return ( + + {children} + + ); +} diff --git a/app/page.tsx b/app/page.tsx new file mode 100644 index 0000000..fbda20b --- /dev/null +++ b/app/page.tsx @@ -0,0 +1,66 @@ +import { Header } from "@/components/Header"; +import { Introduction } from "@/components/Introduction"; +import { Section } from "@/components/Section"; +import { Travel } from "@/components/Travel"; +import { CicdFlow } from "@/components/lab/CicdFlow"; +import { RequestFlow } from "@/components/lab/RequestFlow"; +import { ServiceLinks } from "@/components/lab/ServiceLinks"; +import { StackBadges } from "@/components/lab/StackBadges"; + +function SubHeading({ title, children }: { title: string; children?: React.ReactNode }) { + return ( +
+

{title}

+ {children &&

{children}

} +
+ ); +} + +export default function Home() { + return ( + <> + +
+
+ + +
+ + +
+ + DNS is managed at GoDaddy. From there a request passes through the host Nginx and + the cluster ingress before landing on a pod. + + +
+ +
+ + Gitea Actions builds the image on the Docker Desktop daemon, stores it in Harbor and + deploys it with Helm. A branch push goes to dev, a tag goes to prod. + + +
+ +
+ + Live endpoints you can open yourself. + + +
+
+ + +
+
+ Built with Next.js and deployed by the pipeline described above. +
+ + ); +} diff --git a/components/BrandIcon.tsx b/components/BrandIcon.tsx new file mode 100644 index 0000000..7a1c638 --- /dev/null +++ b/components/BrandIcon.tsx @@ -0,0 +1,23 @@ +import type { SimpleIcon } from "simple-icons"; + +export function BrandIcon({ + icon, + className, + color, +}: { + icon: SimpleIcon; + className?: string; + /** Override the brand colour (dark brand colours vanish on a dark theme). */ + color?: string; +}) { + return ( + + ); +} diff --git a/components/CredentialRows.tsx b/components/CredentialRows.tsx new file mode 100644 index 0000000..5c28cce --- /dev/null +++ b/components/CredentialRows.tsx @@ -0,0 +1,18 @@ +import { KeyRound, User } from "lucide-react"; + +export function CredentialRows({ user, password }: { user: string; password: string }) { + return ( +
+
+
+
{user}
+
+
+
{password}
+
+ ); +} diff --git a/components/Header.tsx b/components/Header.tsx new file mode 100644 index 0000000..287de6a --- /dev/null +++ b/components/Header.tsx @@ -0,0 +1,44 @@ +import { profile } from "@/content/site"; + +const links = [ + { href: "#introduction", label: "Introduction" }, + { href: "#lab", label: "The Lab" }, + { href: "#travel", label: "Travel" }, +]; + +export function Header() { + const initials = profile.name + .split(" ") + .map((w) => w[0]) + .join(""); + + return ( +
+
+ + + {initials} + + {profile.name} + + +
+
+ ); +} diff --git a/components/Introduction.tsx b/components/Introduction.tsx new file mode 100644 index 0000000..b368ce1 --- /dev/null +++ b/components/Introduction.tsx @@ -0,0 +1,24 @@ +import { introduction, profile } from "@/content/site"; + +export function Introduction() { + return ( +
+
+

+ Introduction +

+

+ Hi, I'm{" "} + + {profile.name} + +

+
+ {introduction.map((p, i) => ( +

{p}

+ ))} +
+
+
+ ); +} diff --git a/components/Section.tsx b/components/Section.tsx new file mode 100644 index 0000000..e13391f --- /dev/null +++ b/components/Section.tsx @@ -0,0 +1,30 @@ +import type { ReactNode } from "react"; + +export function Section({ + id, + eyebrow, + title, + lead, + children, +}: { + id: string; + eyebrow: string; + title: string; + lead?: ReactNode; + children: ReactNode; +}) { + return ( +
+
+

+ {eyebrow} +

+

+ {title} +

+ {lead &&
{lead}
} +
{children}
+
+
+ ); +} diff --git a/components/Travel.tsx b/components/Travel.tsx new file mode 100644 index 0000000..47f67c6 --- /dev/null +++ b/components/Travel.tsx @@ -0,0 +1,93 @@ +import { ExternalLink, MapPin, Plane } from "lucide-react"; +import { CredentialRows } from "@/components/CredentialRows"; +import { Section } from "@/components/Section"; +import { travel } from "@/content/site"; + +/** Decorative route map: dotted "world" backdrop, a dashed flight path and pins. */ +function RouteArt() { + const pins = [ + { x: 70, y: 150 }, + { x: 170, y: 70 }, + { x: 290, y: 120 }, + { x: 400, y: 50 }, + ]; + return ( + + + + + + + + + + + + + {pins.map((p, i) => ( + + + + + + ))} + + ); +} + +export function Travel() { + return ( +
+
+
+
+ + + +
+ +
+
+

+

+

+ Sign in with the credentials below to browse the album. +

+
+ + {travel.host} + + +
+
+
+
+ ); +} diff --git a/components/flow.tsx b/components/flow.tsx new file mode 100644 index 0000000..d2d9e22 --- /dev/null +++ b/components/flow.tsx @@ -0,0 +1,121 @@ +import type { CSSProperties, ReactNode } from "react"; +import { ChevronDown, ChevronRight } from "lucide-react"; + +/** One box in a flow diagram: icon tile, title, subtitle and a mono detail line. */ +export function FlowNode({ + icon, + title, + subtitle, + detail, + accent, + step, + className = "", +}: { + icon: ReactNode; + title: string; + subtitle?: string; + detail?: string; + /** Hex colour used for the icon tile glow. */ + accent: string; + step?: number; + className?: string; +}) { + return ( +
+ {step !== undefined && ( + + {step} + + )} +
+ {icon} +
+

{title}

+ {subtitle &&

{subtitle}

} + {detail && ( +

+ {detail} +

+ )} +
+ ); +} + +/** + * Animated dashed connector with an arrow head. Vertical on mobile and + * horizontal on lg+, unless `vertical` pins it to a top-to-bottom hand-off. + */ +export function Connector({ + label, + color = "#38bdf8", + vertical = false, +}: { + label?: string; + color?: string; + vertical?: boolean; +}) { + if (vertical) { + return ( + + ); + } + + return ( + + ); +} + +/** Dashed container that groups nodes belonging to the same host / system. */ +export function Boundary({ + label, + icon, + children, + className = "", + tone = "border-white/15", +}: { + label: string; + icon: ReactNode; + children: ReactNode; + className?: string; + tone?: string; +}) { + return ( +
+
+ {icon} + {label} +
+ {children} +
+ ); +} diff --git a/components/lab/CicdFlow.tsx b/components/lab/CicdFlow.tsx new file mode 100644 index 0000000..b24b4c4 --- /dev/null +++ b/components/lab/CicdFlow.tsx @@ -0,0 +1,139 @@ +import { siDocker, siGit, siGitea, siHarbor, siHelm, siKubernetes } from "simple-icons"; +import { GitBranch, ShieldCheck, Tag, Undo2 } from "lucide-react"; +import { BrandIcon } from "@/components/BrandIcon"; +import { Connector, FlowNode } from "@/components/flow"; + +const lanes = [ + { + env: "DEV", + badge: "border-amber-300/40 bg-amber-300/10 text-amber-200", + ring: "border-amber-300/25", + icon: