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
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: 2

updates:
- package-ecosystem: npm
directory: '/'
schedule:
interval: weekly
day: monday
open-pull-requests-limit: 5
# Grouped so a week of bumps is one or two PRs to review, not fifteen.
# Major production bumps stay ungrouped and get their own PR.
groups:
radix-ui:
patterns:
- '@radix-ui/*'
dev-dependencies:
dependency-type: development
production-minor-patch:
dependency-type: production
update-types:
- minor
- patch

# Workflow actions go stale silently; this is what would have caught the
# Node 20 deprecation on checkout/setup-node before it became an annotation
# on every run.
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: weekly
day: monday
groups:
actions:
patterns:
- '*'
100 changes: 24 additions & 76 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:

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

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: '18'
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
Expand All @@ -40,12 +40,12 @@ jobs:

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

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: '18'
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
Expand All @@ -55,9 +55,9 @@ jobs:
run: npm test -- --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v7
with:
file: ./coverage/lcov.info
files: ./coverage/lcov.info
fail_ci_if_error: false

type-check:
Expand All @@ -66,20 +66,19 @@ jobs:

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

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: '18'
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run type check
run: npm run typecheck
continue-on-error: true # Allow to continue while we fix existing type issues

build:
name: Build Application
Expand All @@ -88,12 +87,12 @@ jobs:

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

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: '18'
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
Expand All @@ -112,10 +111,15 @@ jobs:
GOOGLE_GENAI_API_KEY: ${{ secrets.GOOGLE_GENAI_API_KEY || 'mock-genai-key' }}

- name: Upload build artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: build-files
path: .next/
path: |
.next/
!.next/cache/
# .next is a dotfile directory, and upload-artifact skips hidden
# paths by default -- without this the artifact is empty.
include-hidden-files: true
retention-days: 1

security-scan:
Expand All @@ -124,74 +128,18 @@ jobs:

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

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
uses: aquasecurity/trivy-action@v0.36.0
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
uses: github/codeql-action/upload-sarif@v4
if: always()
with:
sarif_file: 'trivy-results.sarif'

deploy-preview:
name: Deploy Preview (Vercel)
runs-on: ubuntu-latest
needs: [build]
if: github.event_name == 'pull_request'

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

- name: Deploy to Vercel (Preview)
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
github-comment: true

deploy-production:
name: Deploy to Production (Vercel)
runs-on: ubuntu-latest
needs: [build]
if: github.ref == 'refs/heads/main'

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

- name: Deploy to Vercel (Production)
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: '--prod'
github-comment: false

performance-audit:
name: Performance Audit
runs-on: ubuntu-latest
needs: [deploy-preview]
if: github.event_name == 'pull_request'

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

- name: Wait for deployment
run: sleep 30

- name: Run Lighthouse CI
uses: treosh/lighthouse-ci-action@v10
with:
uploadArtifacts: true
temporaryPublicStorage: true
50 changes: 50 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CodeQL

on:
schedule:
# Mondays at 2 AM UTC
- cron: '0 2 * * 1'
workflow_dispatch:

permissions:
contents: read
security-events: write

jobs:
codeql-analysis:
name: CodeQL Security Analysis
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
# CodeQL treats JS and TS as one language; listing both duplicated
# every alert and doubled the runtime.
languages: javascript-typescript

- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build for analysis
run: npm run build
env:
NEXT_PUBLIC_FIREBASE_API_KEY: 'mock-api-key'
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: 'mock.firebaseapp.com'
NEXT_PUBLIC_FIREBASE_PROJECT_ID: 'mock-project'
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: 'mock.appspot.com'
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: '123456789'
NEXT_PUBLIC_FIREBASE_APP_ID: 'mock-app-id'
GOOGLE_GENAI_API_KEY: 'mock-genai-key'

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
Loading