Skip to content

Latest commit

 

History

History
464 lines (367 loc) · 24.2 KB

File metadata and controls

464 lines (367 loc) · 24.2 KB

🎨 Visual Guide: Setting Up GitHub Secrets

This is a step-by-step visual guide to help you set up the required GitHub secrets for automated deployment.


🎯 WHAT YOU'RE SETTING UP

You need to add 3 secrets to GitHub so it can automatically deploy to Vercel:

┌─────────────────────────────────────────────────────┐
│  GitHub Repository                                  │
│  ┌───────────────────────────────────────────────┐ │
│  │  Secrets (Hidden Configuration)               │ │
│  │  ┌─────────────────────────────────────────┐  │ │
│  │  │ VERCEL_TOKEN = abc123...                │  │ │
│  │  │ VERCEL_ORG_ID = team_xyz...             │  │ │
│  │  │ VERCEL_PROJECT_ID = prj_abc...          │  │ │
│  │  └─────────────────────────────────────────┘  │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘
                      ↓
                 Used by
                      ↓
┌─────────────────────────────────────────────────────┐
│  GitHub Actions Workflow                            │
│  (Automatically deploys to Vercel)                  │
└─────────────────────────────────────────────────────┘

📋 STEP 1: GET VERCEL TOKEN

1.1 Go to Vercel Tokens Page

URL: https://vercel.com/account/tokens

┌─────────────────────────────────────────────────────┐
│  Vercel Dashboard                                   │
│  ┌───────────────────────────────────────────────┐ │
│  │  Personal Account Tokens                      │ │
│  │                                                │ │
│  │  [Create Token] ← Click this button           │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

1.2 Create Token

Fill in the form:

┌─────────────────────────────────────────────────────┐
│  Create Token                                       │
│  ┌───────────────────────────────────────────────┐ │
│  │  Token Name: GitHub Actions                   │ │
│  │  Scope: ● Full Account                        │ │
│  │  Expiration: ○ No Expiration                  │ │
│  │                                                │ │
│  │  [Create] ← Click this                        │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

1.3 Copy Token

IMPORTANT: Copy immediately! You won't see it again!

┌─────────────────────────────────────────────────────┐
│  Token Created Successfully                         │
│  ┌───────────────────────────────────────────────┐ │
│  │  vercel_abc123def456ghi789jkl012mno345pqr678  │ │
│  │  [Copy] ← Click to copy                       │ │
│  └───────────────────────────────────────────────┘ │
│                                                     │
│  ⚠️  Save this token now. You won't see it again!  │
└─────────────────────────────────────────────────────┘

Save this as: VERCEL_TOKEN


📋 STEP 2: GET ORG ID & PROJECT ID

2.1 Install Vercel CLI

Open your terminal:

npm install -g vercel
┌─────────────────────────────────────────────────────┐
│  Terminal                                           │
│  ┌───────────────────────────────────────────────┐ │
│  │  $ npm install -g vercel                      │ │
│  │  ✓ Installed vercel@latest                    │ │
│  │  $▊                                            │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

2.2 Clone Repository

git clone https://github.com/christophernemala/tutorialkit.git
cd tutorialkit
┌─────────────────────────────────────────────────────┐
│  Terminal                                           │
│  ┌───────────────────────────────────────────────┐ │
│  │  $ git clone https://github.com/...           │ │
│  │  Cloning into 'tutorialkit'...                │ │
│  │  $ cd tutorialkit                             │ │
│  │  $▊                                            │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

2.3 Login to Vercel

vercel login
┌─────────────────────────────────────────────────────┐
│  Terminal                                           │
│  ┌───────────────────────────────────────────────┐ │
│  │  $ vercel login                               │ │
│  │  > Opening browser to authenticate...         │ │
│  │  ✓ Success! Logged in as you@email.com       │ │
│  │  $▊                                            │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

2.4 Link Project

vercel link
┌─────────────────────────────────────────────────────┐
│  Terminal - Interactive Prompts                     │
│  ┌───────────────────────────────────────────────┐ │
│  │  ? Set up and deploy? Yes                     │ │
│  │  ? Which scope? Your Account                  │ │
│  │  ? Link to existing project? No               │ │
│  │  ? What's your project's name? tutorialkit    │ │
│  │  ? In which directory? ./ (press Enter)       │ │
│  │                                                │ │
│  │  ✓ Linked to your-account/tutorialkit         │ │
│  │  $▊                                            │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

2.5 Get IDs from Configuration File

cat .vercel/project.json
┌─────────────────────────────────────────────────────┐
│  Terminal - Output                                  │
│  ┌───────────────────────────────────────────────┐ │
│  │  {                                             │ │
│  │    "orgId": "team_abc123xyz456",              │ │
│  │    "projectId": "prj_def789ghi012"            │ │
│  │  }                                             │ │
│  │  $▊                                            │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

Copy these values:

  • orgId → Save as VERCEL_ORG_ID
  • projectId → Save as VERCEL_PROJECT_ID

📋 STEP 3: ADD SECRETS TO GITHUB

3.1 Go to GitHub Secrets Page

URL: https://github.com/christophernemala/tutorialkit/settings/secrets/actions

┌─────────────────────────────────────────────────────┐
│  GitHub Repository Settings                         │
│  ┌───────────────────────────────────────────────┐ │
│  │  Secrets and variables > Actions              │ │
│  │                                                │ │
│  │  Repository secrets (0)                       │ │
│  │                                                │ │
│  │  [New repository secret] ← Click this         │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

3.2 Add First Secret: VERCEL_TOKEN

Click "New repository secret":

┌─────────────────────────────────────────────────────┐
│  New secret                                         │
│  ┌───────────────────────────────────────────────┐ │
│  │  Name *                                        │ │
│  │  ┌─────────────────────────────────────────┐  │ │
│  │  │ VERCEL_TOKEN                            │  │ │
│  │  └─────────────────────────────────────────┘  │ │
│  │                                                │ │
│  │  Secret *                                      │ │
│  │  ┌─────────────────────────────────────────┐  │ │
│  │  │ vercel_abc123def456ghi789...            │  │ │
│  │  └─────────────────────────────────────────┘  │ │
│  │                                                │ │
│  │  [Add secret] ← Click this                    │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

3.3 Add Second Secret: VERCEL_ORG_ID

Click "New repository secret" again:

┌─────────────────────────────────────────────────────┐
│  New secret                                         │
│  ┌───────────────────────────────────────────────┐ │
│  │  Name *                                        │ │
│  │  ┌─────────────────────────────────────────┐  │ │
│  │  │ VERCEL_ORG_ID                           │  │ │
│  │  └─────────────────────────────────────────┘  │ │
│  │                                                │ │
│  │  Secret *                                      │ │
│  │  ┌─────────────────────────────────────────┐  │ │
│  │  │ team_abc123xyz456                       │  │ │
│  │  └─────────────────────────────────────────┘  │ │
│  │                                                │ │
│  │  [Add secret] ← Click this                    │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

3.4 Add Third Secret: VERCEL_PROJECT_ID

Click "New repository secret" one more time:

┌─────────────────────────────────────────────────────┐
│  New secret                                         │
│  ┌───────────────────────────────────────────────┐ │
│  │  Name *                                        │ │
│  │  ┌─────────────────────────────────────────┐  │ │
│  │  │ VERCEL_PROJECT_ID                       │  │ │
│  │  └─────────────────────────────────────────┘  │ │
│  │                                                │ │
│  │  Secret *                                      │ │
│  │  ┌─────────────────────────────────────────┐  │ │
│  │  │ prj_def789ghi012                        │  │ │
│  │  └─────────────────────────────────────────┘  │ │
│  │                                                │ │
│  │  [Add secret] ← Click this                    │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

3.5 Verify All Secrets Added

You should now see:

┌─────────────────────────────────────────────────────┐
│  Repository secrets (3)                             │
│  ┌───────────────────────────────────────────────┐ │
│  │  VERCEL_TOKEN          Updated 1 minute ago   │ │
│  │  VERCEL_ORG_ID         Updated 2 minutes ago  │ │
│  │  VERCEL_PROJECT_ID     Updated 3 minutes ago  │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

Perfect! All secrets are configured!


📋 STEP 4: TEST AUTOMATED DEPLOYMENT

4.1 Make a Small Change

echo "# Test auto-deploy" >> README.md

4.2 Commit and Push

git add .
git commit -m "test: trigger automated deployment"
git push origin main
┌─────────────────────────────────────────────────────┐
│  Terminal                                           │
│  ┌───────────────────────────────────────────────┐ │
│  │  $ git add .                                   │ │
│  │  $ git commit -m "test: trigger deployment"   │ │
│  │  [main abc1234] test: trigger deployment      │ │
│  │  $ git push origin main                       │ │
│  │  Enumerating objects: 5, done.                │ │
│  │  Writing objects: 100% (3/3), done.           │ │
│  │  ✓ Pushed to main                             │ │
│  │  $▊                                            │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

4.3 Watch GitHub Actions

Go to: https://github.com/christophernemala/tutorialkit/actions

┌─────────────────────────────────────────────────────┐
│  GitHub Actions                                     │
│  ┌───────────────────────────────────────────────┐ │
│  │  🟡 Production Deployment                     │ │
│  │     test: trigger automated deployment        │ │
│  │     ├─ ✅ Quality Checks (2m 30s)             │ │
│  │     ├─ 🟡 Build (running...)                  │ │
│  │     └─ ⏸️  Deploy (waiting...)                 │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

4.4 Deployment Complete!

After 5-10 minutes:

┌─────────────────────────────────────────────────────┐
│  GitHub Actions                                     │
│  ┌───────────────────────────────────────────────┐ │
│  │  ✅ Production Deployment                     │ │
│  │     test: trigger automated deployment        │ │
│  │     ├─ ✅ Quality Checks (2m 30s)             │ │
│  │     ├─ ✅ Build (5m 15s)                      │ │
│  │     └─ ✅ Deploy (1m 45s)                     │ │
│  │                                                │ │
│  │  🚀 Deployed to:                              │ │
│  │  https://tutorialkit-xyz.vercel.app           │ │
│  └───────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘

🎉 Success! Your platform is live!


VERIFICATION CHECKLIST

After setup, verify everything works:

  • All 3 secrets added to GitHub
  • Secrets have correct names (case-sensitive)
  • Test push triggered workflow
  • Workflow completed successfully
  • Deployment URL is accessible
  • Platform loads correctly
  • WebContainer works

🎯 QUICK REFERENCE

Secret Names (Exact)

VERCEL_TOKEN
VERCEL_ORG_ID
VERCEL_PROJECT_ID

Where to Get Values

Secret Where to Get It
VERCEL_TOKEN https://vercel.com/account/tokens
VERCEL_ORG_ID .vercel/project.json (after vercel link)
VERCEL_PROJECT_ID .vercel/project.json (after vercel link)

Where to Add Secrets

https://github.com/christophernemala/tutorialkit/settings/secrets/actions


🆘 COMMON MISTAKES

Wrong Secret Name

VERCEL-TOKEN  ← Wrong (has dash)
vercel_token  ← Wrong (lowercase)
VERCEL_TOKEN  ← Correct! ✅

Missing Secrets

Only added 2 secrets  ← Wrong
Need all 3 secrets    ← Correct! ✅

Wrong Values

Copied wrong ID from Vercel  ← Wrong
Used orgId from project.json ← Correct! ✅

🎉 CONGRATULATIONS!

You've successfully set up automated deployment!

Now every time you push code:

  1. GitHub Actions automatically builds
  2. Deploys to Vercel
  3. Your changes go live!

No manual deployment needed! 🚀


📚 NEXT STEPS

  1. Create your first tutorial
  2. Customize your platform
  3. Share with the world!

🔗 HELPFUL LINKS


Need help? Check SETUP_VERCEL_SECRETS.md for detailed troubleshooting!

Happy deploying! ✨