Skip to content

Commit b69968c

Browse files
committed
refactor: update CI/CD setup to remove Vercel secrets and streamline deployment process
1 parent 6b7abe4 commit b69968c

File tree

2 files changed

+31
-86
lines changed

2 files changed

+31
-86
lines changed

.github/SECRETS-SETUP.md

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,25 @@
11
# 🔐 GitHub Secrets Setup
22

3-
## Required Secrets for CI/CD
4-
5-
### 1. Go to Repository Settings
6-
```
7-
Your Repository → Settings → Secrets and variables → Actions → "New repository secret"
8-
```
9-
10-
### 2. Add These 3 Secrets:
11-
12-
#### `VERCEL_TOKEN`
13-
- Go to [Vercel Dashboard](https://vercel.com/account/tokens)
14-
- Click "Create Token"
15-
- Copy the token value
16-
17-
#### `VERCEL_ORG_ID` and `VERCEL_PROJECT_ID`
18-
Run in your project directory:
19-
```bash
20-
npx vercel link
21-
cat .vercel/project.json
22-
```
23-
Copy the `orgId` and `projectId` values.
24-
25-
### 3. Create Production Environment
26-
```
27-
Repository → Settings → Environments → "New environment"
28-
```
29-
- Name: `production`
30-
- Add protection rules if needed (optional)
3+
## CI/CD Pipeline
4+
5+
The CI/CD pipeline now runs quality checks, builds, and tests without requiring Vercel secrets since Vercel handles deployments automatically.
6+
7+
### No Secrets Required! 🎉
8+
9+
Since Vercel is configured for automatic deployments from your GitHub repository, you don't need to set up any secrets for basic CI/CD functionality.
10+
11+
### What the Pipeline Does:
12+
13+
1. **Quality Assurance**: Runs ESLint and builds the project
14+
2. **Security Scan**: Checks for vulnerabilities with npm audit
15+
3. **Performance Check**: Runs Lighthouse on pull requests (local server)
16+
17+
### Optional: Advanced Features
18+
19+
If you want to add advanced features later, you might need:
20+
- `SONAR_TOKEN` for SonarCloud code analysis
21+
- Notification webhooks for Slack/Discord
22+
- Database credentials for integration tests
3123

3224
## That's it!
33-
Your CI/CD will now work automatically when you push code.
25+
Your CI/CD works automatically when you push code. Vercel handles all deployments! 🚀

.github/workflows/ci-cd.yml

Lines changed: 10 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -100,78 +100,31 @@ jobs:
100100
run: npm audit --audit-level=high
101101
continue-on-error: true
102102

103-
# Deploy to Vercel (Production)
104-
deploy-production:
105-
name: Deploy to Production
103+
# Lighthouse Performance Check (on PR only)
104+
lighthouse:
105+
name: Lighthouse Performance Check
106106
runs-on: ubuntu-latest
107107
needs: [qa, build]
108-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
109-
environment: production
108+
if: github.event_name == 'pull_request'
110109

111110
steps:
112111
- name: Checkout code
113112
uses: actions/checkout@v4
114113

115-
- name: Download build artifacts
116-
uses: actions/download-artifact@v4
117-
with:
118-
name: build-files
119-
path: dist/
120-
121-
- name: Deploy to Vercel
122-
uses: amondnet/vercel-action@v25
114+
- name: Setup Node.js
115+
uses: actions/setup-node@v4
123116
with:
124-
vercel-token: ${{ secrets.VERCEL_TOKEN }}
125-
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
126-
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
127-
vercel-args: '--prod'
117+
node-version: ${{ env.NODE_VERSION }}
118+
cache: 'npm'
128119

129-
# Deploy to Vercel (Preview)
130-
deploy-preview:
131-
name: Deploy Preview
132-
runs-on: ubuntu-latest
133-
needs: [qa, build]
134-
if: github.event_name == 'pull_request'
135-
136-
steps:
137-
- name: Checkout code
138-
uses: actions/checkout@v4
120+
- name: Install dependencies
121+
run: npm ci
139122

140123
- name: Download build artifacts
141124
uses: actions/download-artifact@v4
142125
with:
143126
name: build-files
144127
path: dist/
145-
146-
- name: Deploy Preview to Vercel
147-
uses: amondnet/vercel-action@v25
148-
with:
149-
vercel-token: ${{ secrets.VERCEL_TOKEN }}
150-
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
151-
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
152-
153-
- name: Comment PR with preview URL
154-
uses: actions/github-script@v7
155-
if: github.event_name == 'pull_request'
156-
with:
157-
script: |
158-
github.rest.issues.createComment({
159-
issue_number: context.issue.number,
160-
owner: context.repo.owner,
161-
repo: context.repo.repo,
162-
body: '🚀 Preview deployment is ready! Check it out at the Vercel deployment URL.'
163-
})
164-
165-
# Lighthouse Performance Check
166-
lighthouse:
167-
name: Lighthouse Performance Check
168-
runs-on: ubuntu-latest
169-
needs: deploy-preview
170-
if: github.event_name == 'pull_request'
171-
172-
steps:
173-
- name: Checkout code
174-
uses: actions/checkout@v4
175128

176129
- name: Run Lighthouse CI
177130
uses: treosh/lighthouse-ci-action@v11

0 commit comments

Comments
 (0)