Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
.github
.next
node_modules
npm-debug.log
README.md
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ on:
- 'package.json'
- 'package-lock.json'
- 'next.config.*'
- 'postcss.config.*'
- 'tsconfig.json'
- 'eslint.config.*'
- 'Dockerfile'
- '.dockerignore'
- '.github/workflows/ci.yml'
pull_request:
paths:
Expand All @@ -21,8 +24,11 @@ on:
- 'package.json'
- 'package-lock.json'
- 'next.config.*'
- 'postcss.config.*'
- 'tsconfig.json'
- 'eslint.config.*'
- 'Dockerfile'
- '.dockerignore'
- '.github/workflows/ci.yml'
workflow_dispatch:

Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: CodeQL

on:
push:
branches:
- main
- master
paths:
- 'src/**'
- 'public/**'
- 'package.json'
- 'package-lock.json'
- 'next.config.*'
- 'postcss.config.*'
- 'tsconfig.json'
- 'eslint.config.*'
- '.github/workflows/codeql.yml'
pull_request:
paths:
- 'src/**'
- 'public/**'
- 'package.json'
- 'package-lock.json'
- 'next.config.*'
- 'postcss.config.*'
- 'tsconfig.json'
- 'eslint.config.*'
- '.github/workflows/codeql.yml'
schedule:
- cron: '30 3 * * 1'
workflow_dispatch:

permissions:
actions: read
contents: read
security-events: write

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language:
- javascript-typescript

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: package-lock.json

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: none

- name: Install dependencies
run: npm ci

- name: Analyze
uses: github/codeql-action/analyze@v3

104 changes: 104 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Container

on:
push:
branches:
- main
- master
tags:
- 'v*'
paths:
- 'src/**'
- 'public/**'
- 'package.json'
- 'package-lock.json'
- 'next.config.*'
- 'postcss.config.*'
- 'tsconfig.json'
- 'Dockerfile'
- '.dockerignore'
- '.github/workflows/container.yml'
pull_request:
paths:
- 'src/**'
- 'public/**'
- 'package.json'
- 'package-lock.json'
- 'next.config.*'
- 'postcss.config.*'
- 'tsconfig.json'
- 'Dockerfile'
- '.dockerignore'
- '.github/workflows/container.yml'
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
docker-build:
name: Docker Build
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: false
tags: neurolab-docs:ci
cache-from: type=gha
cache-to: type=gha,mode=max

ghcr-publish:
name: Build And Push GHCR Image
runs-on: ubuntu-latest
timeout-minutes: 30
needs: docker-build
if: github.event_name != 'pull_request'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=tag
type=sha
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM node:22-bookworm-slim AS deps
WORKDIR /app

COPY package.json package-lock.json ./
RUN npm ci

FROM node:22-bookworm-slim AS builder
WORKDIR /app

COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build

FROM node:22-bookworm-slim AS runner
WORKDIR /app

ENV NODE_ENV=production
ENV PORT=3000

COPY package.json package-lock.json ./
RUN npm ci --omit=dev && npm cache clean --force

COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/next.config.ts ./next.config.ts

EXPOSE 3000

CMD ["npm", "run", "start"]

8 changes: 6 additions & 2 deletions src/components/site-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { docsConfig } from '@/config/docs'
import { MobileNav } from '@/components/mobile-nav'
import { ThemeToggle } from '@/components/theme-toggle'
import { Search } from '@/components/search'
import { LucideGithub } from 'lucide-react'

export function SiteHeader() {
const pathname = usePathname()
Expand Down Expand Up @@ -44,12 +45,15 @@ export function SiteHeader() {
</nav>
</div>
<div className='flex flex-1 items-center justify-between space-x-2 md:justify-end'>
<div className='rounded-md border border-zinc-200 p-2 transition-colors hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-900'>
<LucideGithub />
Comment thread
m-prosper-10 marked this conversation as resolved.
</div>
<div className='w-full flex-1 md:w-auto md:flex-none'>
<Search />
</div>
<nav className='flex items-center'>
<div className='rounded-md border border-zinc-200 transition-colors hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-900'>
<ThemeToggle />
</nav>
</div>
</div>
</div>
</header>
Expand Down
9 changes: 4 additions & 5 deletions src/components/theme-toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ export function ThemeToggle() {

return (
<Button
variant="ghost"
size="icon"
onClick={() => setTheme(theme === "light" ? "dark" : "light")}
className="h-9 w-9"
className=""
variant="ghost"
>
<Sun className="h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<Moon className="absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<Sun className="rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<Moon className="absolute rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<span className="sr-only">Toggle theme</span>
</Button>
)
Expand Down
9 changes: 2 additions & 7 deletions src/config/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,9 @@ export const docsConfig: DocsConfig = {
href: '/docs/architecture',
},
{
title: 'AI API',
title: 'AI/ML Services',
href: '/docs/api/ai-service',
},
{
title: 'GitHub',
href: 'https://github.com/neurolab',
external: true,
},
}
],
sidebarNav: [
{
Expand Down
Loading