File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11## Vercel Deployments
22
3- ### Feature PR to main [ vercel- preview-pr.yml] ( ./vercel- preview-pr.yml )
4- - Runs checks: lint, test, e2e: test
5- - Creates a preview URL to test feature using the DEV environment
6- - Generate Lighthouse report based on preview URL
3+ ### Feature PR to main [ preview-pr.yml] ( ./preview-pr.yml )
4+ - Runs checks: lint, test (for all) , e2e: test (for vercel access prs)
5+ - Creates a preview URL to test feature using the DEV environment (for vercel access prs)
6+ - Generate Lighthouse report based on preview URL (for vercel access prs)
77
88### When feature is merged to main
99- Vercel automatically deploys any new changes done in main to the staging environment
Original file line number Diff line number Diff line change 1- name : Vercel Preview (PR)
1+ name : Preview (PR)
22
33on :
44 pull_request :
55 branches : [main]
6- types : [opened, synchronize, reopened]
76
87concurrency :
98 group : vercel-preview-${{ github.event.pull_request.number }}
109 cancel-in-progress : true
1110
11+ env :
12+ NODE_VERSION : ' 24.12.0'
13+
1214jobs :
13- deploy_preview :
14- # ✅ Only run for same-repo PRs (not forks)
15- if : ${{ github.event.pull_request.head.repo.full_name == github.repository }}
15+ # ✅ Runs for all PRs (including forks)
16+ lint_and_test :
17+ runs-on : ubuntu-latest
18+
19+ steps :
20+ - name : Checkout PR
21+ uses : actions/checkout@v4
22+
23+ - name : Setup Node
24+ uses : actions/setup-node@v4
25+ with :
26+ node-version : ${{ env.NODE_VERSION }}
27+ cache : yarn
28+
29+ - name : Install dependencies
30+ run : yarn install --frozen-lockfile --prefer-offline
31+
32+ - name : Lint
33+ run : yarn lint
34+
35+ - name : Unit tests
36+ run : yarn test:ci
1637
38+ # ✅ Only runs for same-repo PRs (not forks) - requires secrets
39+ e2e_and_preview :
40+ if : ${{ github.event.pull_request.head.repo.full_name == github.repository }}
41+ needs : lint_and_test
1742 runs-on : ubuntu-latest
1843 permissions :
1944 contents : read
3762 - name : Setup Node
3863 uses : actions/setup-node@v4
3964 with :
40- node-version : 24.12.0
65+ node-version : ${{ env.NODE_VERSION }}
4166 cache : yarn
4267
4368 - name : Install dependencies
5176 restore-keys : |
5277 cypress-${{ runner.os }}-binary-
5378
54- - name : Lint
55- run : yarn lint
56-
57- - name : Unit tests
58- run : yarn test:ci
59-
6079 - name : Install Vercel CLI
6180 run : npm i -g vercel@latest
6281
Original file line number Diff line number Diff line change 55 release :
66 types : [published]
77
8+ env :
9+ NODE_VERSION : ' 24.12.0'
10+
811jobs :
912 deploy :
1013 runs-on : ubuntu-latest
3033 - name : Setup Node
3134 uses : actions/setup-node@v4
3235 with :
33- node-version : 24.12.0
36+ node-version : ${{ env.NODE_VERSION }}
3437 cache : ' yarn'
3538
3639 - name : Install Vercel CLI
4548 - uses : actions/cache@v4
4649 with :
4750 path : .next/cache
48- key : ${{ runner.os }}-nextcache-node24.12.0 -${{ hashFiles('yarn.lock') }}-${{ github.sha }}
51+ key : ${{ runner.os }}-nextcache-node${{ env.NODE_VERSION }} -${{ hashFiles('yarn.lock') }}-${{ github.sha }}
4952 restore-keys : |
50- ${{ runner.os }}-nextcache-node24.12.0 -${{ hashFiles('yarn.lock') }}-
53+ ${{ runner.os }}-nextcache-node${{ env.NODE_VERSION }} -${{ hashFiles('yarn.lock') }}-
5154
5255
5356 - name : Install deps
You can’t perform that action at this time.
0 commit comments