-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (105 loc) · 5.04 KB
/
ci.yml
File metadata and controls
124 lines (105 loc) · 5.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: CI / Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
# ── 1. Type-check & Build ─────────────────────────────────────────────────
build:
name: Type-check & Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Type-check
run: npx tsc --noEmit
- name: Build
run: npm run build
env:
NEXT_PUBLIC_SITE_NAME: RelientOps
NEXT_PUBLIC_SITE_URL: https://relientops.io
NEXT_PUBLIC_SITE_TAGLINE: "Freelance DevOps & Cloud Consulting"
NEXT_PUBLIC_SITE_DESCRIPTION: "Production-grade cloud infrastructure, Kubernetes, and CI/CD — built by a senior DevOps engineer."
NEXT_PUBLIC_SITE_OG_IMAGE: /og-image.png
NEXT_PUBLIC_CONTACT_EMAIL: sagardeepak2002@gmail.com
NEXT_PUBLIC_SOCIAL_GITHUB: https://github.com/sagarDeepakDevOps
NEXT_PUBLIC_SOCIAL_LINKEDIN: https://linkedin.com/in/sagardeepak2002
NEXT_PUBLIC_OWNER_NAME: Deepak Sagar
NEXT_PUBLIC_OWNER_TITLE: "Freelance DevOps & Cloud Engineer"
NEXT_PUBLIC_OWNER_EXPERIENCE: "3+"
NEXT_PUBLIC_OWNER_EXPERIENCE_LABEL: "years of production DevOps experience"
NEXT_PUBLIC_OWNER_BIO: "Senior DevOps engineer specialising in AWS, Kubernetes, Terraform, and CI/CD automation."
NEXT_PUBLIC_OWNER_LINKEDIN: https://linkedin.com/in/sagardeepak2002
NEXT_PUBLIC_FREE_REVIEW_HREF: /free-review
NEXT_PUBLIC_FREE_REVIEW_DURATION: "20 min"
NEXT_PUBLIC_CALENDLY_URL: https://calendly.com/sagardeepak2002/30min
# ── 2. Deploy to Vercel (production — main branch only) ───────────────────
deploy:
name: Deploy to Vercel (Production)
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Install Vercel CLI
run: npm install --global vercel@latest
# Write all NEXT_PUBLIC_ vars into .env.production so `vercel build`
# picks them up automatically — no shell-quoting issues with spaces.
- name: Write .env.production
run: |
cat > .env.production <<'ENVEOF'
NEXT_PUBLIC_SITE_NAME=RelientOps
NEXT_PUBLIC_SITE_TAGLINE=Freelance DevOps & Cloud Engineering
NEXT_PUBLIC_SITE_DESCRIPTION=I design, build, and operate cloud-native infrastructure. From Kubernetes to CI/CD pipelines, I help startups ship faster and stay reliable.
NEXT_PUBLIC_SITE_URL=https://relientops.io
NEXT_PUBLIC_SITE_OG_IMAGE=/images/og-default.png
NEXT_PUBLIC_CONTACT_EMAIL=sagardeepak2002@gmail.com
NEXT_PUBLIC_SOCIAL_GITHUB=https://github.com/sagarDeepakDevOps
NEXT_PUBLIC_SOCIAL_LINKEDIN=https://linkedin.com/in/sagardeepak2002
NEXT_PUBLIC_OWNER_NAME=Deepak Sagar
NEXT_PUBLIC_OWNER_TITLE=Freelance DevOps & Cloud Engineer
NEXT_PUBLIC_OWNER_EXPERIENCE=3+
NEXT_PUBLIC_OWNER_EXPERIENCE_LABEL=Hands-On Cloud & Automation Experience
NEXT_PUBLIC_OWNER_BIO=I work directly with founders and engineering teams to design, automate, and stabilize cloud environments across AWS and Azure.
NEXT_PUBLIC_OWNER_LINKEDIN=https://linkedin.com/in/sagardeepak2002
NEXT_PUBLIC_FREE_REVIEW_HREF=/free-review
NEXT_PUBLIC_FREE_REVIEW_DURATION=30 min
NEXT_PUBLIC_CALENDLY_URL=https://calendly.com/sagardeepak2002/30min
ENVEOF
# Pull project metadata (creates .vercel/ directory)
- name: Pull Vercel project settings
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
# Add the server-only secret to the Vercel project (idempotent)
- name: Set RESEND_API_KEY on Vercel
run: |
echo "${{ secrets.RESEND_API_KEY }}" \
| vercel env add RESEND_API_KEY production \
--token=${{ secrets.VERCEL_TOKEN }} --force
# Build locally using Vercel's build pipeline (honours .env.production)
- name: Build
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
# Upload the pre-built output — no re-build on Vercel's side
- name: Deploy prebuilt output
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}