Skip to content

Commit 15e2a40

Browse files
ci: add production workflow and fix ESLint/compilation errors
1 parent 54343a9 commit 15e2a40

6 files changed

Lines changed: 98 additions & 4 deletions

File tree

.github/workflows/production.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Production CI/CD
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
validate:
13+
name: Lint, Typecheck and Build
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: 'npm'
25+
26+
- name: Install Dependencies
27+
run: npm ci
28+
29+
- name: Run Linter
30+
run: npm run lint
31+
32+
- name: Run Typecheck
33+
run: npm run typecheck
34+
35+
- name: Production Build
36+
run: npm run build
37+
env:
38+
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}
39+
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
40+
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
41+
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
42+
43+
check-secrets:
44+
name: Check Secrets Availability
45+
runs-on: ubuntu-latest
46+
outputs:
47+
has_vercel_token: ${{ steps.check.outputs.has_vercel_token }}
48+
steps:
49+
- id: check
50+
env:
51+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
52+
run: |
53+
if [ -n "$VERCEL_TOKEN" ]; then
54+
echo "has_vercel_token=true" >> $GITHUB_OUTPUT
55+
else
56+
echo "has_vercel_token=false" >> $GITHUB_OUTPUT
57+
fi
58+
59+
deploy:
60+
name: Deploy to Production
61+
needs: [validate, check-secrets]
62+
runs-on: ubuntu-latest
63+
# Run only on pushes to main and if the Vercel token secret is configured
64+
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && needs.check-secrets.outputs.has_vercel_token == 'true'
65+
66+
steps:
67+
- name: Checkout Code
68+
uses: actions/checkout@v4
69+
70+
- name: Install Vercel CLI
71+
run: npm install --global vercel@latest
72+
73+
- name: Pull Vercel Environment Information
74+
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
75+
env:
76+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
77+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
78+
79+
- name: Build Project Artifacts
80+
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
81+
env:
82+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
83+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
84+
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}
85+
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
86+
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
87+
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
88+
89+
- name: Deploy Project Artifacts to Vercel
90+
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
91+
env:
92+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
93+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ next-env.d.ts
3737

3838
# clerk configuration (can include secrets)
3939
/.clerk/
40+
.env*

app/palettes/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export default function PalettesPage() {
254254
<Search className="w-6 h-6 text-muted-foreground" />
255255
</div>
256256
<p className="text-muted-foreground font-medium">
257-
No palettes found matching "{searchQuery}"
257+
No palettes found matching &quot;{searchQuery}&quot;
258258
</p>
259259
<Button variant="outline" onClick={() => setSearchQuery("")}>Clear Search</Button>
260260
</div>

components/color-picker/manual-color-picker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ export default function ManualColorPicker() {
492492
/>
493493
</div>
494494
<div className="absolute top-0 right-0 p-2 text-[10px] font-medium text-white/30 font-mono pointer-events-none">
495-
/* Generated from ColorPicker */
495+
{"/* Generated from ColorPicker */"}
496496
</div>
497497
</div>
498498
</TabsContent>

components/home/testimonials.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function Testimonials() {
6767
<Quote className="w-10 h-10 text-primary/20 mb-6 group-hover:text-primary/40 transition-colors" />
6868

6969
<p className="text-lg leading-relaxed text-foreground/80 font-ranade mb-8">
70-
"{testimonial.content}"
70+
&quot;{testimonial.content}&quot;
7171
</p>
7272

7373
<div className="flex items-center gap-4">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "next dev",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "next lint",
9+
"lint": "eslint .",
1010
"typecheck": "tsc --noEmit"
1111
},
1212
"dependencies": {

0 commit comments

Comments
 (0)