Restaurant Speisekarte

Docs & Code reference

Deploy to Vercel (GitHub Actions)

This document explains the deploy.yml workflow located at .github/workflows/deploy.yml.

Purpose

Triggers

Jobs

Workflow (excerpt)

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-node@v4
      with:
        node-version: '18'
        cache: 'npm'
    - run: npm ci
    - run: npm run lint
    - run: npm run build
    - run: npm test --if-present

  deploy:
    needs: test
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-node@v4
      with:
        node-version: '18'
        cache: 'npm'
    - run: npm ci
    - run: npm run build
    - name: Deploy to Vercel
      # The repository previously used the community `vercel/action` which may be unavailable.
      # Current workflow installs the official Vercel CLI and runs `vercel --prod` using `VERCEL_TOKEN`.
      run: |
        npm i -g vercel@latest
        vercel --prod --confirm
      with:
        vercel-token: ${{ secrets.VERCEL_TOKEN }}
        vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
        vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
        vercel-args: '--prod'

Notes & Recommendations