Skip to content

Commit d52d388

Browse files
committed
Refactor deployment workflow and update Node.js engine requirement
- Changed Node.js engine requirement in package.json to "22.x". - Updated GitHub Actions workflow to use actions/checkout@v4 and actions/cache@v4. - Replaced npm install commands with bun commands for dependency management. - Added concurrency control for deployments to Vercel.
1 parent d83f0d0 commit d52d388

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

.github/workflows/deploy.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,45 @@ name: Deploy to Vercel
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: ['main']
76
pull_request:
8-
branches:
9-
- main
7+
branches: ['main']
8+
workflow_dispatch:
9+
10+
# Allow only one concurrent deployment
11+
concurrency:
12+
group: 'vercel'
13+
cancel-in-progress: true
1014

1115
jobs:
12-
deploy:
16+
build:
1317
runs-on: ubuntu-latest
1418
env:
1519
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
1620
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
1721
steps:
18-
- name: Check out code
19-
uses: actions/checkout@v3
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Bun
26+
uses: oven-sh/setup-bun@v1
27+
with:
28+
bun-version: latest
2029

21-
- name: Set up Node.js
22-
uses: actions/setup-node@v3
30+
- name: Restore cache
31+
uses: actions/cache@v4
2332
with:
24-
node-version: '20'
33+
path: |
34+
.next/cache
35+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
36+
restore-keys: |
37+
${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}-
2538
2639
- name: Install dependencies
27-
run: |
28-
if [ -f package-lock.json ]; then
29-
npm ci
30-
else
31-
npm install --legacy-peer-deps
32-
fi
40+
run: bun install
3341

3442
- name: Install Vercel CLI
35-
run: npm install -g vercel
43+
run: bun add -g vercel@latest
3644

3745
- name: Pull Vercel environment variables
3846
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@
5656
"typescript": "^5.7.2"
5757
},
5858
"engines": {
59-
"node": ">=20.0.0"
59+
"node": "22.x"
6060
}
6161
}

0 commit comments

Comments
 (0)