diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8b64f0e..d3b3133d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,22 +4,23 @@ on: pull_request: branches: - master - + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: '20' - - - name: Install Dependencies - run: npm install - - - name: Generate prisma client - run: npm run db:generate - - - name: Run Build - run: npm run build + -uses: action/checkout@v3 + -name: Use Node.js + uses: action/setup-node@v3 + with: + node-version: '20' + + -name: Install dependencies + run: npm install + + -name: Generate prisma client + run: npm run db:generate + + -name: Run build + run: npm run dev + \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index acbed6e5..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build and Deploy to Docker Hub - -on: - push: - branches: - - master - -jobs: - build-and-push: - runs-on: ubuntu-latest - steps: - - name: Check Out Repo - uses: actions/checkout@v2 - - - name: Log in to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and Push Docker image - uses: docker/build-push-action@v2 - with: - context: . - file: ./docker/Dockerfile.user - push: true - tags: 100xdevs/week-18-class:latest # Replace with your Docker Hub username and repository - - - name: Verify Pushed Image - run: docker pull 100xdevs/week-18-class:latest # Replace with your Docker Hub username and repository - - - name: Deploy to EC2 - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.SSH_HOST }} - username: ${{ secrets.SSH_USERNAME }} - key: ${{ secrets.SSH_KEY }} - script: | - sudo docker pull 100xdevs/week-18-class:latest - sudo docker stop web-app || true - sudo docker rm web-app || true - sudo docker run -d --name web-app -p 3005:3000 100xdevs/week-18-class:latest \ No newline at end of file diff --git a/apps/user-app/app/page.tsx b/apps/user-app/app/page.tsx index 0288eb02..5506725d 100644 --- a/apps/user-app/app/page.tsx +++ b/apps/user-app/app/page.tsx @@ -1,12 +1,13 @@ import { getServerSession } from "next-auth"; -import { redirect } from 'next/navigation' +import { redirect } from "next/navigation"; import { authOptions } from "./lib/auth"; export default async function Page() { + console.log("asdf"); const session = await getServerSession(authOptions); if (session?.user) { - redirect('/dashboard') + redirect("/dashboard"); } else { - redirect('/api/auth/signin') + redirect("/api/auth/signin"); } } diff --git a/package.json b/package.json index 4be5bbb6..23f13fd7 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,8 @@ "dev": "turbo dev", "lint": "turbo lint", "format": "prettier --write \"**/*.{ts,tsx,md}\"", - "db:generate": "cd packages/db && npx prisma generate && cd ../..", - "start-user-app": "cd ./apps/user-app && npm run start" - + "start-user-app": "cd ./apps/user-app && npm run start", + "db:generate": "cd packages/db && npx prisma generate && cd ../.." }, "devDependencies": { "@repo/eslint-config": "*",