mirror of
https://github.com/bitbaum/botsmann.git
synced 2026-12-06 02:28:18 +01:00
pdf-parse v2 depends on @napi-rs/canvas which requires DOMMatrix (available via process.getBuiltinModule in Node 22+). The build crashes with "ReferenceError: DOMMatrix is not defined" on Node 18. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
name: Deploy to Vercel
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies and build
|
|
run: npm run build:ci
|
|
env:
|
|
NEXT_PUBLIC_DEPLOY_TIME: ${{ github.event.head_commit.timestamp }}
|
|
|
|
- name: Run format check
|
|
run: npm run format:check --if-present
|
|
|
|
- name: Run linting
|
|
run: npm run lint --if-present
|
|
|
|
- name: Run tests
|
|
run: npm run test --if-present
|
|
|
|
- name: Deploy to Vercel (Preview)
|
|
if: github.event_name == 'pull_request'
|
|
uses: amondnet/vercel-action@v25
|
|
with:
|
|
vercel-token: ${{ secrets.VERCEL_TOKEN }}
|
|
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
|
|
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
vercel-args: '--prod=false'
|
|
working-directory: ./
|
|
alias-domains: |-
|
|
pr-{{ pr-number }}.${{ secrets.VERCEL_TEAM_URL }}
|
|
|
|
- name: Deploy to Vercel (Production)
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
uses: amondnet/vercel-action@v25
|
|
with:
|
|
vercel-token: ${{ secrets.VERCEL_TOKEN }}
|
|
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
|
|
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
vercel-args: '--prod=true'
|
|
working-directory: ./
|
|
|
|
- name: Health Check
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
run: |
|
|
echo "Deployment completed successfully"
|
|
echo "Site will be available at: https://${{ secrets.VERCEL_TEAM_URL }}"
|