Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vercel setting for production deployment #41

Merged
merged 6 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy to Vercel

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secrets have already set via github-cli.

gh secret set VERCEL_ORG_ID -b"xxx" --repo tabi-memo/frontend
gh secret set VERCEL_PROJECT_ID -b"xxx" --repo tabi-memo/frontend
gh secret set VERCEL_TOKEN -b"xxx" --repo tabi-memo/frontend

VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Install Node.js dependencies
run: |
pnpm i --frozen-lockfile

- name: Pull Vercel Environment Information
run: pnpm run vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: pnpm run vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy to Vercel
run: pnpm run vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
5 changes: 5 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ const nextConfig = {
hostname: '127.0.0.1',
port: '54321',
pathname: '/storage/v1/object/public/**'
},
{
protocol: 'https',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setting is needed to display uploaded images on production environment.

If the setting is nothing, Next.js automatically add link to image_url like https://xxx.com/_next/image?referer=https://image_object_url .

hostname: 'ndmxdrvtdsakizkewsan.supabase.co',
pathname: '/storage/v1/object/public/**'
}
]
}
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"build-storybook": "storybook build",
"codegen": "graphql-codegen --require dotenv/config --config graphql-codegen/codegen.ts",
"test": "jest",
"test:watch": "jest --watch"
"test:watch": "jest --watch",
"vercel": "vercel",
"deploy": "vercel --prod"
},
"dependencies": {
"@apollo/client": "^3.8.7",
Expand All @@ -23,9 +25,9 @@
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@graphql-codegen/client-preset": "^4.1.0",
"@supabase/auth-helpers-nextjs": "^0.8.7",
"@supabase/auth-helpers-nextjs": "^0.9.0",
"@types/jest": "^29.5.11",
"date-fns-tz": "^2.0.0",
"date-fns-tz": "^2.0.1",
"framer-motion": "^10.16.4",
"graphql": "^16.8.1",
"next": "14.0.1",
Expand Down Expand Up @@ -55,7 +57,7 @@
"@storybook/nextjs": "^7.5.3",
"@storybook/react": "^7.5.3",
"@storybook/testing-library": "^0.2.2",
"@supabase/ssr": "^0.0.10",
"@supabase/ssr": "^0.1.0",
"@supabase/supabase-js": "^2.38.5",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
Expand Down Expand Up @@ -83,6 +85,7 @@
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5",
"vercel": "^33.6.1",
"zod": "^3.22.4"
},
"peerDependencies": {
Expand Down
Loading
Loading