Skip to content

Commit f94fd40

Browse files
committed
feat: restore Vercel deployment workflow and add setup guide
1 parent 1dfbf6d commit f94fd40

2 files changed

Lines changed: 64 additions & 37 deletions

File tree

.github/VERCEL_SETUP.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Vercel Deployment Setup Guide
2+
3+
## 🔧 **Required GitHub Secrets**
4+
5+
To enable Vercel deployment, you need to add these secrets to your GitHub repository:
6+
7+
### 1. **VERCEL_TOKEN**
8+
- Go to [Vercel Dashboard](https://vercel.com/account/tokens)
9+
- Create a new token with appropriate permissions
10+
- Copy the token value
11+
12+
### 2. **VERCEL_ORG_ID**
13+
- Go to [Vercel Dashboard](https://vercel.com/account)
14+
- Copy your Organization ID from the URL or settings
15+
16+
### 3. **VERCEL_PROJECT_ID**
17+
- Go to your project in Vercel Dashboard
18+
- Copy the Project ID from the project settings
19+
20+
## 📋 **How to Add Secrets to GitHub**
21+
22+
1. Go to your GitHub repository
23+
2. Click **Settings****Secrets and variables****Actions**
24+
3. Click **New repository secret**
25+
4. Add each secret:
26+
- Name: `VERCEL_TOKEN`, Value: `[your-vercel-token]`
27+
- Name: `VERCEL_ORG_ID`, Value: `[your-org-id]`
28+
- Name: `VERCEL_PROJECT_ID`, Value: `[your-project-id]`
29+
30+
## 🚀 **Expected Results**
31+
32+
Once secrets are configured:
33+
- ✅ Vercel deployments will work automatically
34+
- ✅ GitHub will show deployment stats and counts
35+
- ✅ Site will be deployed to: `https://prepguides-dev.vercel.app`
36+
- ✅ Preview deployments will work for PRs
37+
38+
## 🔍 **Troubleshooting**
39+
40+
If deployments still fail:
41+
1. Verify all three secrets are correctly set
42+
2. Check Vercel token permissions
43+
3. Ensure project exists in Vercel dashboard
44+
4. Check GitHub Actions logs for specific error messages

.github/workflows/deploy.yml

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,34 @@
1-
name: Deploy to GitHub Pages
1+
name: Deploy to Vercel
22

33
on:
44
push:
55
branches: [ main ]
66
pull_request:
77
branches: [ main ]
88

9-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10-
permissions:
11-
contents: read
12-
pages: write
13-
id-token: write
14-
15-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17-
concurrency:
18-
group: "pages"
19-
cancel-in-progress: false
20-
219
jobs:
2210
deploy:
2311
runs-on: ubuntu-latest
2412
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
25-
environment:
26-
name: github-pages
27-
url: ${{ steps.deployment.outputs.page_url }}
2813

2914
steps:
3015
- name: Checkout code
3116
uses: actions/checkout@v4
3217

33-
- name: Setup Pages
34-
uses: actions/configure-pages@v4
35-
36-
- name: Upload artifact
37-
uses: actions/upload-pages-artifact@v3
18+
- name: Deploy to Vercel
19+
uses: amondnet/vercel-action@v25
3820
with:
39-
path: '.'
40-
41-
- name: Deploy to GitHub Pages
42-
id: deployment
43-
uses: actions/deploy-pages@v4
21+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
22+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
23+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
24+
working-directory: ./
25+
scope: ${{ secrets.VERCEL_ORG_ID }}
4426

4527
- name: Deployment Status
4628
run: |
4729
echo "🚀 Deployment completed successfully!"
4830
echo "📊 This will show deployment stats in GitHub"
49-
echo "🔗 Site deployed to: ${{ steps.deployment.outputs.page_url }}"
31+
echo "🔗 Site deployed to: https://prepguides-dev.vercel.app"
5032
5133
preview:
5234
runs-on: ubuntu-latest
@@ -56,16 +38,17 @@ jobs:
5638
- name: Checkout code
5739
uses: actions/checkout@v4
5840

59-
- name: Preview Validation
60-
run: |
61-
echo "🔍 Validating files for preview deployment..."
62-
find . -name "*.html" -not -path "./.git/*" | head -5 | while read file; do
63-
echo "Preview checking: $file"
64-
done
65-
echo "✅ Preview validation completed"
41+
- name: Deploy Preview to Vercel
42+
uses: amondnet/vercel-action@v25
43+
with:
44+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
45+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
46+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
47+
working-directory: ./
48+
scope: ${{ secrets.VERCEL_ORG_ID }}
49+
vercel-args: '--prod=false'
6650

67-
- name: Preview Ready
51+
- name: Preview Deployment Status
6852
run: |
69-
echo "🔍 Preview deployment ready!"
53+
echo "🔍 Preview deployment completed!"
7054
echo "📊 This will show preview deployment stats in GitHub"
71-
echo "✅ Preview validation completed successfully"

0 commit comments

Comments
 (0)