Skip to content

Commit 1fd20f4

Browse files
committed
pr updates
1 parent 2637c3e commit 1fd20f4

3 files changed

Lines changed: 41 additions & 19 deletions

File tree

.github/workflows/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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
Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,44 @@
1-
name: Vercel Preview (PR)
1+
name: Preview (PR)
22

33
on:
44
pull_request:
55
branches: [main]
6-
types: [opened, synchronize, reopened]
76

87
concurrency:
98
group: vercel-preview-${{ github.event.pull_request.number }}
109
cancel-in-progress: true
1110

11+
env:
12+
NODE_VERSION: '24.12.0'
13+
1214
jobs:
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
@@ -37,7 +62,7 @@ jobs:
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
@@ -51,12 +76,6 @@ jobs:
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

.github/workflows/vercel-prod-on-release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
release:
66
types: [published]
77

8+
env:
9+
NODE_VERSION: '24.12.0'
10+
811
jobs:
912
deploy:
1013
runs-on: ubuntu-latest
@@ -30,7 +33,7 @@ jobs:
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
@@ -45,9 +48,9 @@ jobs:
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

0 commit comments

Comments
 (0)