diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7f1961d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI + +on: + push: + branches: ["main", "dev"] + pull_request: + types: [opened, synchronize] + +jobs: + build: + name: Build + timeout-minutes: 15 + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Install dependencies + run: bun install + + - name: Build + run: bun run build diff --git a/bun.lockb b/bun.lockb index 5e3e079..c3d7772 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index ff95d38..e886e35 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,10 @@ "next": "14.2.3", "next-themes": "^0.3.0", "nextjs-toploader": "^1.6.12", + "posthog-js": "^1.131.4", "react": "^18", "react-dom": "^18", "react-hook-form": "^7.51.4", - "sharp": "^0.33.3", "sonner": "^1.4.41", "tailwind-merge": "^2.3.0", "tailwindcss-animate": "^1.0.7", @@ -40,13 +40,13 @@ "zod": "^3.23.6" }, "devDependencies": { - "typescript": "^5", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", + "eslint": "^8", + "eslint-config-next": "14.2.0", "postcss": "^8", "tailwindcss": "^3.4.1", - "eslint": "^8", - "eslint-config-next": "14.2.0" + "typescript": "^5" } } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 01ddaa8..2a9a287 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -6,6 +6,7 @@ import { Toaster } from "@/components/ui/sonner"; import NextTopLoader from "nextjs-toploader"; import Navbar from "@/components/navbar"; import "./globals.css"; +import { CSPostHogProvider } from "./provider"; export const metadata: Metadata = { metadataBase: new URL("https://www.github-stats.omsimos.com"), @@ -34,14 +35,16 @@ export default function RootLayout({ }>) { return ( - - - - - - {children} - - + + + + + + + {children} + + + ); } diff --git a/src/app/provider.tsx b/src/app/provider.tsx new file mode 100644 index 0000000..7d5608e --- /dev/null +++ b/src/app/provider.tsx @@ -0,0 +1,14 @@ +"use client"; + +import posthog from "posthog-js"; +import { PostHogProvider } from "posthog-js/react"; + +if (typeof window !== "undefined") { + posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, { + api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST, + }); +} + +export function CSPostHogProvider({ children }: { children: React.ReactNode }) { + return {children}; +}