Skip to content

Commit

Permalink
Merge branch 'main' into sidebar-active-indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
devsargam authored Sep 24, 2024
2 parents ab22337 + 9ac8b87 commit 400e192
Show file tree
Hide file tree
Showing 39 changed files with 1,834 additions and 861 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ NEXT_PUBLIC_DISABLE_FEATURES = "featurea,featureb,featurec"
REDIS_URL=
GITHUB_ID=
GITHUB_SECRET=
NEXT_PUBLIC_DISCORD_WEBHOOK_URL =
JOB_BOARD_AUTH_SECRET=


COHORT3_DISCORD_ACCESS_KEY =
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Continuous Deployment
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Docker login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile.prod
push: true
tags: 100xdevs/cms-staging:${{ github.sha }}
build-args: |
DATABASE_URL=${{ secrets.STAGING_DATABASE }}
- name: Clone staging-ops repo, update, and push
env:
PAT: ${{ secrets.PAT }}
run: |
git clone https://github.com/code100x/staging-ops.git
cd staging-ops
sed -i 's|image: 100xdevs/cms-staging:.*|image: 100xdevs/cms-staging:${{ github.sha }}|' staging/cms/deployment.yml
git config user.name "GitHub Actions Bot"
git config user.email "[email protected]"
git add staging/cms/deployment.yml
git commit -m "Update cms image to ${{ github.sha }}"
git push https://${PAT}@github.com/code100x/staging-ops.git main
43 changes: 43 additions & 0 deletions .github/workflows/cd_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Continuous Deployment (Prod)
on:
push:
branches: [ production ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Docker login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile.prod
push: true
tags: 100xdevs/cms:${{ github.sha }}
build-args: |
DATABASE_URL=${{ secrets.PROD_DATABASE }}
- name: Clone staging-ops repo, update, and push
env:
PAT: ${{ secrets.PAT }}
run: |
git clone https://github.com/code100x/staging-ops.git
cd staging-ops
sed -i 's|image: 100xdevs/cms:.*|image: 100xdevs/cms:${{ github.sha }}|' prod/cms/deployment.yml
git config user.name "GitHub Actions Bot"
git config user.email "[email protected]"
git add prod/cms/deployment.yml
git commit -m "Update cms image to ${{ github.sha }}"
git push https://${PAT}@github.com/code100x/staging-ops.git main
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
branches:
- '**'

jobs:

Continuous-Integration:
Expand All @@ -15,10 +15,10 @@ jobs:
uses: actions/checkout@v3

- name: Install Dependencies
run: npm install --legacy-peer-deps
run: pnpm install --legacy-peer-deps

- name: Run linting check
run: npm run lint:check
run: pnpm run lint:check

- name: Check formatting
run: npm run format:check
run: pnpm run format:check
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ git clone https://github.com/code100x/cms.git

```

```bash

git clone https://github.com/code100x/cms.git

```

2. Navigate to the project directory:

Expand All @@ -42,11 +38,7 @@ cd cms

```

```bash

cd cms

```

3. Run the following command to start the application:

Expand All @@ -58,13 +50,7 @@ docker-compose up

```

```bash

docker volume create postgres-data # (optional) run this command if you face any mount volume / volume not exist error

docker-compose up

```

### Without Docker

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-navigation-menu": "^1.1.4",
"@radix-ui/react-popover": "^1.1.1",
"@radix-ui/react-radio-group": "^1.2.0",
"@radix-ui/react-scroll-area": "^1.1.0",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.0",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-tooltip": "^1.0.7",
"@tabler/icons-react": "^3.14.0",
"@types/bcrypt": "^5.0.2",
Expand Down
17 changes: 9 additions & 8 deletions src/actions/videopreview/videoPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
'use server';
import db from '@/db';
// import db from '@/db';

export default async function VideoPreview({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
contentId,
}: {
contentId: number;
}) {
const videoMetadata = await db.videoMetadata.findFirst({
where: { contentId },
select: { video_360p_1: true },
});
// const videoMetadata = await db.videoMetadata.findFirst({
// where: { contentId },
// select: { video_360p_1: true },
// });

if (videoMetadata) {
return videoMetadata.video_360p_1;
}
// if (videoMetadata) {
// return videoMetadata.video_360p_1;
// }
return null;
}
14 changes: 2 additions & 12 deletions src/app/(main)/(pages)/home/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Greeting } from '@/components/Greeting';
import { MyCourses } from '@/components/MyCourses';
import { Redirect } from '@/components/Redirect';
import SearchBar from '@/components/search/SearchBar';
Expand All @@ -10,22 +11,11 @@ export default async function MyCoursesPage() {
return <Redirect to={'/'} />;
}

// Get the current hour
const currentHour = new Date().getHours();

// Determine the appropriate greeting based on the time of day
let greeting = 'Good Morning';
if (currentHour >= 12 && currentHour < 18) {
greeting = 'Good Afternoon';
} else if (currentHour >= 18 || currentHour < 5) {
greeting = 'Good Evening';
}

return (
<main className="flex flex-col gap-4 pb-16 pt-8">
<div className="flex flex-col justify-between gap-4 lg:flex-row">
<h1 className="text-wrap text-3xl font-extrabold capitalize tracking-tighter md:text-4xl">
{greeting} {session.user.name}
<Greeting /> {session.user.name}
</h1>
<SearchBar />
</div>
Expand Down
Loading

0 comments on commit 400e192

Please sign in to comment.