Skip to content

Update ci.yml

Update ci.yml #7

Workflow file for this run

name: Next.js CI and Deployment
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm ci
- name: Run Tests
run: npm test
- name: Build
run: npm run build
- name: Vercel Deployment
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: npx vercel --token ${{ secrets.VERCEL_TOKEN }} --prod
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}