Skip to content

Commit 9e3615a

Browse files
committed
ci: add GitHub Actions workflows for project build and linting
1 parent 5237fcb commit 9e3615a

5 files changed

Lines changed: 90 additions & 6 deletions

File tree

.github/workflows/build.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: ['*']
6+
pull_request:
7+
branches: ['*']
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Create .env from secrets
31+
run: |
32+
cat <<EOF > .env
33+
CLOUDINARY_API_KEY=${{ secrets.CLOUDINARY_API_KEY }}
34+
CLOUDINARY_API_SECRET=${{ secrets.CLOUDINARY_API_SECRET }}
35+
CLOUDINARY_CLOUD_NAME=${{ secrets.CLOUDINARY_CLOUD_NAME }}
36+
EVALUATOR_CODE=${{ secrets.EVALUATOR_CODE }}
37+
METRICS_API_TOKEN=${{ secrets.METRICS_API_TOKEN }}
38+
MONGODB_URI=${{ secrets.MONGODB_URI }}
39+
NEXT_PUBLIC_FIREBASE_API_KEY=${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }}
40+
NEXT_PUBLIC_FIREBASE_APP_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }}
41+
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }}
42+
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }}
43+
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }}
44+
NEXT_PUBLIC_FIREBASE_PROJECT_ID=${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}
45+
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }}
46+
NEXT_PUBLIC_POSTHOG_HOST=${{ secrets.NEXT_PUBLIC_POSTHOG_HOST }}
47+
NEXT_PUBLIC_POSTHOG_KEY=${{ secrets.NEXT_PUBLIC_POSTHOG_KEY }}
48+
RECAPTCHA_SECRET_KEY=${{ secrets.RECAPTCHA_SECRET_KEY }}
49+
EOF
50+
51+
- name: Build
52+
run: npm run build

.github/workflows/lint.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: ['*']
6+
pull_request:
7+
branches: ['*']
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Lint
31+
run: npm run lint
32+
continue-on-error: true

app/api/analytics/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export async function GET(request: NextRequest) {
5757
User.countDocuments({ role: "user" }),
5858
Team.countDocuments({}),
5959
Team.countDocuments({
60-
teamStatus: { $in: ["submitted", "under-review"] },
60+
teamStatus: { $in: ["submitted"] },
6161
}),
6262
Team.countDocuments({ evaluations: { $exists: true, $ne: [] } }),
6363
Team.countDocuments({

app/api/cron/analytics-update/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export async function GET(request: NextRequest) {
1919
const [totalUsers, totalTeams, totalSubmissions, totalEvaluated] = await Promise.all([
2020
User.countDocuments({ role: 'user' }),
2121
Team.countDocuments({}),
22-
Team.countDocuments({ teamStatus: { $in: ['submitted', 'under-review', 'shortlisted', 'accepted', 'rejected'] } }),
23-
Team.countDocuments({ teamStatus: { $in: ['shortlisted', 'accepted', 'rejected'] } }),
22+
Team.countDocuments({ teamStatus: { $in: ['submitted', 'shortlisted', 'rsvped', 'rsvp_declined'] } }),
23+
Team.countDocuments({ teamStatus: { $in: ['shortlisted', 'rsvped', 'rsvp_declined'] } }),
2424
]);
2525

2626
const registered = Math.max(0, totalTeams - (totalSubmissions + totalEvaluated));

app/shortlisted/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const itemVariants = {
2828
scale: 1,
2929
transition: {
3030
duration: 0.4,
31-
ease: [0.25, 0.46, 0.45, 0.94]
31+
ease: [0.25, 0.46, 0.45, 0.94] as const
3232
}
3333
}
3434
};
@@ -40,7 +40,7 @@ const heroVariants = {
4040
y: 0,
4141
transition: {
4242
duration: 0.6,
43-
ease: "easeOut"
43+
ease: "easeOut" as const
4444
}
4545
}
4646
};
@@ -52,7 +52,7 @@ const statVariants = {
5252
scale: 1,
5353
transition: {
5454
duration: 0.5,
55-
ease: "easeOut"
55+
ease: "easeOut" as const
5656
}
5757
}
5858
};

0 commit comments

Comments
 (0)