Compare commits

..

No commits in common. "a0956c37cfdb12e8e8462a390a341ffffc8640a8" and "0e26e3945b374cee3473c7f46c25610adea73223" have entirely different histories.

7 changed files with 94 additions and 187 deletions

View file

@ -1,15 +1,9 @@
{ {
"permissions": { "permissions": {
"allow": [ "allow": [
"Bash(find:*)", "Bash(find:*)",
"Bash(ls:*)", "Bash(ls:*)"
"Bash(git pull:*)", ],
"Bash(git remote set-url:*)", "deny": []
"Bash(git add:*)", }
"Bash(git commit:*)",
"Bash(mv:*)",
"Bash(git checkout:*)"
],
"deny": []
}
} }

View file

@ -1,37 +0,0 @@
name: CI
on:
push:
branches: [ main, master, feature/* ]
pull_request:
branches: [ main, master ]
jobs:
test:
runs-on: self-hosted
steps:
- name: Checkout code
uses: https://codeberg.org/actions/checkout@v4
- name: Cache node modules
uses: https://codeberg.org/actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
- name: Run type checking
run: npm run typecheck
- name: Build application
run: npm run build
env:
# Use empty string for YOUTUBE_API_KEY during CI build
YOUTUBE_API_KEY: ""

View file

@ -1,49 +0,0 @@
name: Deploy
on:
push:
branches: [ main, master ]
workflow_dispatch:
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Checkout code
uses: https://codeberg.org/actions/checkout@v4
- name: Cache node modules
uses: https://codeberg.org/actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Build application
run: npm run build
env:
# Access YouTube API key from repository secrets
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
- name: Deploy to S3 (if configured)
run: |
if [ -n "${{ secrets.AWS_ACCESS_KEY_ID }}" ]; then
echo "Deploying to S3..."
npm run deploy:s3
else
echo "AWS credentials not configured, skipping S3 deployment"
fi
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
- name: Upload build artifacts
uses: https://codeberg.org/actions/upload-artifact@v3
with:
name: build-output
path: out/

View file

@ -1,60 +1,66 @@
# Workflow for building and testing Next.js site on non-master branches # Workflow for building and testing Next.js site on non-master branches
name: Build Check name: Build Check
on: on:
# Runs on pushes to any branch except master # Runs on pushes to any branch except master
push: push:
branches-ignore: ["master"] branches-ignore: ["master"]
# Runs on pull requests targeting any branch # Runs on pull requests targeting any branch
pull_request: pull_request:
branches: ["*"] branches: ["*"]
# Allow multiple concurrent build checks # Allow multiple concurrent build checks
concurrency: concurrency:
group: "build-check-${{ github.ref }}" group: "build-check-${{ github.ref }}"
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
build-check: build-check:
runs-on: self-hosted runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
steps: steps:
- name: Checkout - name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4 uses: actions/checkout@v4
- name: Install dependencies - name: Setup Node.js
run: npm ci uses: actions/setup-node@v4
with:
- name: Restore Next.js cache node-version: "20"
uses: https://code.forgejo.org/actions/cache@v4 cache: 'npm'
with:
path: | - name: Install dependencies
.next/cache run: npm ci
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: | - name: Restore Next.js cache
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- uses: actions/cache@v4
with:
- name: Run linting path: |
run: npm run lint .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
- name: Build Next.js site restore-keys: |
run: npm run build ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- name: Run tests (if available) - name: Run linting
run: | run: npm run lint
if npm run test --if-present; then
echo "✅ Tests passed" - name: Build Next.js site
else run: npm run build
echo " No tests found or tests skipped"
fi - name: Run tests (if available)
continue-on-error: true run: |
if npm run test --if-present; then
- name: Build verification complete echo "✅ Tests passed"
run: | else
echo "🎉 Build verification successful!" echo " No tests found or tests skipped"
echo "✅ Dependencies installed" fi
echo "✅ Linting passed" continue-on-error: true
echo "✅ Build completed successfully"
echo "Ready for review and merge!" - name: Build verification complete
run: |
echo "🎉 Build verification successful!"
echo "✅ Dependencies installed"
echo "✅ Linting passed"
echo "✅ Build completed successfully"
echo "Ready for review and merge!"

View file

@ -16,14 +16,20 @@ concurrency:
jobs: jobs:
build-and-deploy: build-and-deploy:
runs-on: self-hosted runs-on: ubuntu-latest
permissions: permissions:
id-token: write id-token: write
contents: read contents: read
steps: steps:
- name: Checkout - name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: 'npm'
- name: Create .env.local file - name: Create .env.local file
run: | run: |
echo "YOUTUBE_API_KEY=${{ secrets.YOUTUBE_API_KEY }}" > .env.local echo "YOUTUBE_API_KEY=${{ secrets.YOUTUBE_API_KEY }}" > .env.local
@ -33,7 +39,7 @@ jobs:
run: npm ci run: npm ci
- name: Restore Next.js cache - name: Restore Next.js cache
uses: https://code.forgejo.org/actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
.next/cache .next/cache
@ -48,20 +54,12 @@ jobs:
run: npm run build:static run: npm run build:static
- name: Configure AWS credentials - name: Configure AWS credentials
# Note: aws-actions/configure-aws-credentials is GitHub-specific uses: aws-actions/configure-aws-credentials@v4
# For Forgejo, we'll use environment variables directly with:
env: role-to-assume: ${{ secrets.CC_OIDC_ROLE }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-region: us-east-1
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
run: |
echo "AWS credentials configured via environment variables"
- name: Deploy to S3 - name: Deploy to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
run: | run: |
aws s3 sync out/ s3://${{ secrets.S3_BUCKET_NAME }} --delete --no-cli-pager aws s3 sync out/ s3://${{ secrets.S3_BUCKET_NAME }} --delete --no-cli-pager

View file

@ -21,10 +21,6 @@ npm run start # Start production server
# Quality Checks # Quality Checks
npm run lint # Run Next.js linting npm run lint # Run Next.js linting
npm run typecheck # Run TypeScript type checking npm run typecheck # Run TypeScript type checking
# Deployment
npm run deploy:s3 # Deploy to AWS S3 bucket
npm run create-s3-bucket # Create S3 bucket for deployment
``` ```
## Architecture Overview ## Architecture Overview
@ -33,7 +29,7 @@ npm run create-s3-bucket # Create S3 bucket for deployment
- **App Router**: Uses Next.js App Router in `src/app/` - **App Router**: Uses Next.js App Router in `src/app/`
- **Pages**: Homepage, Gallery (YouTube videos), Dadvocate (curated videos), Long Story - **Pages**: Homepage, Gallery (YouTube videos), Dadvocate (curated videos), Long Story
- **Static Generation**: Pages use static generation with ISR for external data - **Static Generation**: Pages use static generation with ISR for external data
- **Deployment**: Supports Static hosting (S3), Firebase App Hosting, and Vercel - **Deployment**: Supports GitHub Pages, Firebase App Hosting, and Vercel
### Key Patterns ### Key Patterns
1. **UI Components**: Full shadcn/ui component library in `src/components/ui/` 1. **UI Components**: Full shadcn/ui component library in `src/components/ui/`
@ -47,7 +43,6 @@ npm run create-s3-bucket # Create S3 bucket for deployment
- **YouTube API**: Gallery and Dadvocate pages fetch video data with 1-hour cache - **YouTube API**: Gallery and Dadvocate pages fetch video data with 1-hour cache
- **AI Integration**: Genkit setup exists but is minimally implemented - **AI Integration**: Genkit setup exists but is minimally implemented
- **Theme**: Dark/light mode support via next-themes - **Theme**: Dark/light mode support via next-themes
- **Pre-commit**: Husky runs linting before commits
### Adding Features ### Adding Features
- New pages: Create directory in `src/app/` with `page.tsx` and metadata export - New pages: Create directory in `src/app/` with `page.tsx` and metadata export

View file

@ -17,7 +17,7 @@ A Next.js application built to expose harmful activities and support Kristen Jac
- **Language**: TypeScript - **Language**: TypeScript
- **UI Components**: shadcn/ui component library - **UI Components**: shadcn/ui component library
- **Styling**: Tailwind CSS with custom theming - **Styling**: Tailwind CSS with custom theming
- **Hosting**: Supports Static hosting (S3), Firebase App Hosting, and Vercel - **Hosting**: Supports GitHub Pages, Firebase App Hosting, and Vercel
- **AI Integration**: Google Genkit (minimal implementation) - **AI Integration**: Google Genkit (minimal implementation)
## 📋 Prerequisites ## 📋 Prerequisites
@ -30,7 +30,7 @@ A Next.js application built to expose harmful activities and support Kristen Jac
1. Clone the repository: 1. Clone the repository:
```bash ```bash
git clone ssh://gitea@git.deco.sh/signal-works/cheatingchelsea.git git clone https://github.com/yourusername/cheatingchelsea.git
cd cheatingchelsea cd cheatingchelsea
``` ```
@ -86,8 +86,8 @@ npm run start
This application supports multiple deployment platforms: This application supports multiple deployment platforms:
### Static Hosting (AWS S3) ### GitHub Pages
The project includes CI/CD workflow for automatic deployment to AWS S3. The project includes GitHub Actions workflow for automatic deployment to GitHub Pages.
### Firebase App Hosting ### Firebase App Hosting
Deploy using Firebase CLI: Deploy using Firebase CLI:
@ -96,7 +96,7 @@ firebase deploy
``` ```
### Vercel ### Vercel
Deploy directly from Git repository through Vercel dashboard or CLI. Deploy directly from GitHub repository through Vercel dashboard or CLI.
## 📁 Project Structure ## 📁 Project Structure