Skip to content

Kaif/branch02 #461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
21 changes: 11 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
name: Build on PR

on:
on:
pull_request:
branches:
- master

jobs:
build:
jobs:
build:
runs-on: ubuntu-latest
steps:
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
with:
node-version: '20'

- name: Install Dependencies
- name: Install dependencies
run: npm install

- name: Generate prisma client
run: npm run db:generate

- name: Run Build
run: npm run build

28 changes: 8 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build and Deploy to Docker Hub
name: build and Deploy to Docker Hub

on:
on:
push:
branches:
- master
Expand All @@ -9,34 +9,22 @@ jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
- name: Check out Repo
uses: actions/checkout@v2

- name: Log in to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Push Docker image
- 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

tags: kaifkhan01/week-18-class:latest
- 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
run: docker pull kaifkhan01/week-18-class:latest
8 changes: 8 additions & 0 deletions apps/user-app/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@




import { getServerSession } from "next-auth";
import { redirect } from 'next/navigation'
import { authOptions } from "./lib/auth";





export default async function Page() {
const session = await getServerSession(authOptions);
if (session?.user) {
Expand Down
1 change: 0 additions & 1 deletion apps/user-app/components/AddMoneyCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client"
import { Button } from "@repo/ui/button";
import { Card } from "@repo/ui/card";
import { Center } from "@repo/ui/center";
import { Select } from "@repo/ui/select";
import { useState } from "react";
import { TextInput } from "@repo/ui/textinput";
Expand Down
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"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"

},
"devDependencies": {
"@repo/eslint-config": "*",
Expand Down