Add vercel build #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Next.js App | |
on: | |
push: | |
branches: | |
- test | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout code | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Setup Node.js | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 # Change to your Node.js version | |
cache: 'npm' | |
# Step 3: Install dependencies | |
- name: Install dependencies | |
run: npm install | |
# Step 4: Build the app | |
- name: Build Next.js app | |
run: npm run build | |
# Step 5: Deploy to Vercel (Optional) | |
- name: Deploy to Vercel | |
uses: amondnet/[email protected] | |
with: | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
vercel-org-id: ${{ vars.VERCEL_ORG_ID }} | |
vercel-project-id: ${{ vars.VERCEL_PROJECT_ID }} | |
working-directory: ./ | |
vercel-args: '--prod' |