diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..91b8241 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,65 @@ +name: CI/CD Pipeline + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' # Adjust to your current node version if different + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build Next.js application + run: npm run build + env: + # Note: You might need to supply build-time secrets here + # NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }} + # NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }} + + # Deployment job: Deploys via SSH to a server running Docker Compose + # + # To use this: + # 1. Go to your GitHub repository -> Settings -> Secrets and variables -> Actions + # 2. Add New repository secrets: + # - SERVER_HOST: The IP address or domain of your deployment server + # - SERVER_USER: The SSH username (e.g., ubuntu, root) + # - SERVER_SSH_KEY: Your private SSH key + deploy: + needs: build + # Only run deploy if pushing to the main branch + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + runs-on: ubuntu-latest + + steps: + - name: Deploy to production server + # You can use standard SSH actions to connect to your EC2 / VPS / Server + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.SERVER_HOST }} + username: ${{ secrets.SERVER_USER }} + key: ${{ secrets.SERVER_SSH_KEY }} + script: | + # Navigate to the folder where your project is cloned on the server + # e.g., cd /var/www/internal_application + cd /path/to/your/project/on/server + + # Pull the latest code + git pull origin main + + # Rebuild and restart the Docker containers + docker compose down + docker compose up --build -d diff --git a/app/dashboard/components/CountdownTimer.tsx b/app/dashboard/components/CountdownTimer.tsx deleted file mode 100644 index e8803cc..0000000 --- a/app/dashboard/components/CountdownTimer.tsx +++ /dev/null @@ -1,85 +0,0 @@ -'use client'; - -import { useState, useEffect } from 'react'; -import { motion } from 'framer-motion'; - -const TARGET_DATE = new Date('2026-02-22T11:00:00+05:30').getTime(); // Assuming IST based on context - -export default function CountdownTimer({ teamName }: { teamName: string }) { - const [timeLeft, setTimeLeft] = useState({ - days: 0, - hours: 0, - minutes: 0, - seconds: 0 - }); - - useEffect(() => { - const calculateTimeLeft = () => { - const now = new Date().getTime(); - const difference = TARGET_DATE - now; - - if (difference > 0) { - setTimeLeft({ - days: Math.floor(difference / (1000 * 60 * 60 * 24)), - hours: Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)), - minutes: Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60)), - seconds: Math.floor((difference % (1000 * 60)) / 1000) - }); - } else { - setTimeLeft({ days: 0, hours: 0, minutes: 0, seconds: 0 }); - } - }; - - const timer = setInterval(calculateTimeLeft, 1000); - calculateTimeLeft(); - - return () => clearInterval(timer); - }, []); - - const TimeUnit = ({ value, label }: { value: number, label: string }) => ( -
- - {String(value).padStart(2, '0')} - - - {label} - -
- ); - - return ( - -

Welcome

-

- {teamName} -

-
-

- CODING ENDS IN -

- -
- - : - - : - - : - -
- - - - -
- ); -} diff --git a/next.config.ts b/next.config.ts index e9ffa30..ed23578 100644 --- a/next.config.ts +++ b/next.config.ts @@ -2,6 +2,7 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { /* config options here */ + output: "standalone", }; export default nextConfig; diff --git a/public/CNAME b/public/CNAME new file mode 100644 index 0000000..8cf89ec --- /dev/null +++ b/public/CNAME @@ -0,0 +1 @@ +dashboard.makeaton.in