Skip to content

Commit 65bfdb0

Browse files
authored
Merge branch 'main' into feature/og-meta-tags
Signed-off-by: amritbej.sh <amritbej750@gmail.com>
2 parents a3da22a + ba56e95 commit 65bfdb0

32 files changed

Lines changed: 1051 additions & 216 deletions

.github/scripts/commentResults.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module.exports = async ({
99
backendTypecheck,
1010
mobileLint,
1111
mobileTest,
12-
webCheck,
1312
webBuild,
1413
backendLintOutput,
1514
mobileLintOutput,
@@ -57,7 +56,6 @@ ${mobileLint === 'failure' ? lintDetails(mobileLintOutput) : ''}
5756
5857
| Check | Result |
5958
|---|---|
60-
| Check | ${status(webCheck)} |
6159
| Build | ${status(webBuild)} |
6260
6361
---

.github/scripts/triagePr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = async ({github, context}) => {
1010
const mobileFiles = [];
1111
const devopsFiles = [];
1212

13-
const labels = [];
13+
const labels = ['gssoc:approved'];
1414
let primaryArea = null;
1515
let reviewer = null;
1616

.github/workflows/ci.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ jobs:
9393
runs-on: ubuntu-latest
9494

9595
outputs:
96-
check_result: ${{ steps.web_check.outcome }}
9796
build_result: ${{ steps.web_build.outcome }}
9897

9998
steps:
@@ -108,20 +107,13 @@ jobs:
108107
- name: Install web dependencies
109108
run: npm --prefix apps/web install
110109

111-
- name: Web check
112-
id: web_check
113-
continue-on-error: true
114-
run: npm --prefix apps/web run lint
115-
116110
- name: Web build
117111
id: web_build
118112
continue-on-error: true
119113
run: npm --prefix apps/web run build
120114

121115
- name: Fail job if any check failed
122-
if: >
123-
steps.web_check.outcome == 'failure' ||
124-
steps.web_build.outcome == 'failure'
116+
if: steps.web_build.outcome == 'failure'
125117
run: exit 1
126118

127119
mobile-ci:
@@ -191,7 +183,6 @@ jobs:
191183
backendLint: '${{ needs.backend-ci.outputs.lint_result }}',
192184
backendTest: '${{ needs.backend-ci.outputs.test_result }}',
193185
backendTypecheck: '${{ needs.backend-ci.outputs.typecheck_result }}',
194-
webCheck: '${{ needs.web-ci.outputs.check_result }}',
195186
webBuild: '${{ needs.web-ci.outputs.build_result }}',
196187
mobileLint: '${{ needs.mobile-ci.outputs.lint_result }}',
197188
mobileTest: '${{ needs.mobile-ci.outputs.test_result }}',

.github/workflows/uat.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: UAT Deploy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
detect-changes:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
backend: ${{ steps.changes.outputs.backend }}
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: dorny/paths-filter@v3
16+
id: changes
17+
with:
18+
filters: |
19+
backend:
20+
- 'apps/backend/**'
21+
22+
backend-deploy:
23+
needs: detect-changes
24+
if: needs.detect-changes.outputs.backend == 'true'
25+
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
id-token: write
29+
30+
steps:
31+
- name: Checkout app repo
32+
uses: actions/checkout@v4
33+
34+
- name: Checkout infra repo
35+
uses: actions/checkout@v4
36+
with:
37+
repository: Dev-Card/devcard-infra
38+
path: infra
39+
token: ${{ secrets.INFRA_REPO_TOKEN }}
40+
41+
- name: Authenticate to GCP
42+
uses: google-github-actions/auth@v2
43+
with:
44+
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
45+
service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }}
46+
47+
- name: Setup gcloud
48+
uses: google-github-actions/setup-gcloud@v2
49+
50+
- name: Configure Docker for Artifact Registry
51+
run: gcloud auth configure-docker asia-south1-docker.pkg.dev
52+
53+
- name: Set image tag
54+
id: tag
55+
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
56+
57+
- name: Setup Node.js
58+
uses: actions/setup-node@v4
59+
with:
60+
node-version: 20
61+
cache: npm
62+
cache-dependency-path: apps/backend/package-lock.json
63+
64+
- name: Install dependencies
65+
working-directory: apps/backend
66+
run: npm ci
67+
68+
# TODO: Once tests are fixed, uncomment the following lines
69+
# - name: Run tests
70+
# working-directory: apps/backend
71+
# run: npm test
72+
73+
- name: Build and push Docker image
74+
run: |
75+
docker build \
76+
-f docker/backend.Dockerfile \
77+
-t asia-south1-docker.pkg.dev/devcard-prod/devcard/backend:${{ steps.tag.outputs.sha }} \
78+
.
79+
docker push asia-south1-docker.pkg.dev/devcard-prod/devcard/backend:${{ steps.tag.outputs.sha }}
80+
81+
- name: Get GKE credentials
82+
uses: google-github-actions/get-gke-credentials@v2
83+
with:
84+
cluster_name: devcard-cluster
85+
location: asia-south1
86+
87+
- name: Run Prisma migrations
88+
run: |
89+
cat <<EOF | kubectl apply -f -
90+
apiVersion: batch/v1
91+
kind: Job
92+
metadata:
93+
name: prisma-migrate-${{ steps.tag.outputs.sha }}
94+
namespace: uat
95+
spec:
96+
ttlSecondsAfterFinished: 300
97+
template:
98+
spec:
99+
restartPolicy: Never
100+
containers:
101+
- name: migrate
102+
image: asia-south1-docker.pkg.dev/devcard-prod/devcard/backend:${{ steps.tag.outputs.sha }}
103+
command: ["npx", "prisma", "migrate", "deploy"]
104+
env:
105+
- name: DATABASE_URL
106+
valueFrom:
107+
secretKeyRef:
108+
name: devcard-secret
109+
key: database-url
110+
EOF
111+
kubectl wait --for=condition=complete \
112+
job/prisma-migrate-${{ steps.tag.outputs.sha }} \
113+
-n uat --timeout=120s
114+
115+
- name: Update image tag in kustomize
116+
run: |
117+
cd infra/k8s/overlays/uat
118+
kustomize edit set image IMAGE_TAG_PLACEHOLDER=asia-south1-docker.pkg.dev/devcard-prod/devcard/backend:${{ steps.tag.outputs.sha }}
119+
120+
- name: Commit and push image tag to infra repo
121+
run: |
122+
cd infra
123+
git config user.name "github-actions[bot]"
124+
git config user.email "github-actions[bot]@users.noreply.github.com"
125+
git add k8s/overlays/uat/kustomization.yaml
126+
git commit -m "chore: update uat backend image to ${{ steps.tag.outputs.sha }}"
127+
git push
128+
129+
- name: Deploy to UAT
130+
run: kubectl apply -k infra/k8s/overlays/uat
131+
132+
- name: Wait for rollout
133+
run: |
134+
kubectl rollout status deployment/backend \
135+
-n uat --timeout=5m

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@
2222

2323
---
2424

25+
## Table of Contents
26+
- [The Problem](#the-problem)
27+
- [The Solution](#the-solution)
28+
- [Features](#features)
29+
- [Quick Start](#quick-start)
30+
- [Architecture](#architecture)
31+
- [Tech Stack](#tech-stack)
32+
- [API Endpoints](#api-endpoints)
33+
- [Good First Issues](#good-first-issues)
34+
- [Contributing](#contributing)
35+
- [Contributors](#contributors)
36+
- [Project Support](#project-support)
37+
- [License](#license)
38+
39+
---
40+
2541
## The Problem
2642

2743
At every developer meetup, hackathon, or conference, the same friction plays out:

0 commit comments

Comments
 (0)