Skip to content

Example of deploying from organization repository to vercel personal hobby account

Notifications You must be signed in to change notification settings

ut-code/vercel-example

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

Getting Started

  • gitリポジトリをつくります
npx create-next-app@latest
  • GitHubにpushします
  • Vercelにプロジェクトを作ります。ただし、VercelのUIからではなく次のようにコマンドからやります。
npx vercel deploy
Vercel CLI 41.1.4
? Set up and deploy “~/projects/vercel-example”? yes
? Which scope should contain your project? natrium144's projects
? Link to existing project? no
? What’s your project’s name? vercel-example
? In which directory is your code located? ./
Local settings detected in vercel.json:
Auto-detected Project Settings (Next.js):
- Build Command: next build
- Development Command: next dev --port $PORT
- Install Command: `yarn install`, `pnpm install`, `npm install`, or `bun install`
- Output Directory: Next.js default
? Want to modify these settings? no
🔗  Linked to natrium144s-projects/vercel-example (created .vercel)
  • Vercel の Account Settings → Tokens へ行き、Tokenを作成します
  • GitHubでリポジトリの Settings → Secrets and variables → Actions へ行き、 Repository Secrets に以下を追加しましょう
    • VERCEL_TOKEN: 先ほど作成したToken
    • VERCEL_ORG_ID: .vercel/project.json 内にある orgId
    • VERCEL_PROJECT_ID: .vercel/project.json 内にある projectId
  • GitHub ActionのWorkflowファイルを作成し、pushします。(これのコピペですが)
  • main以外のブランチに変更がpushされるとpreviewとしてデプロイされ、mainに変更がpushされるとproductionとしてデプロイされます
    • ただし、デプロイされたpreviewは、vercelアカウントを持っている1人以外アクセスできないか、あるいはprotectionを切って誰でもアクセスできるようにするかの2択しかなさそうなのであんまり意味ないかも?

About

Example of deploying from organization repository to vercel personal hobby account

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published