Skip to content

Commit 875beb8

Browse files
committed
feat: deploy vercel script add (#183)
1 parent c15ed94 commit 875beb8

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,38 @@ jobs:
4444

4545
- name: Build
4646
run: yarn build
47+
48+
deploy-vercel:
49+
runs-on: ubuntu-latest
50+
needs: build
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
55+
- name: Setup Node.js environment
56+
uses: actions/setup-node@v4
57+
with:
58+
node-version: 18
59+
cache: "yarn"
60+
61+
- name: Get yarn cache directory path
62+
id: yarn-cache-dir-path
63+
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
64+
65+
- uses: actions/cache@v3
66+
id: yarn-cache
67+
with:
68+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
69+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
70+
restore-keys: |
71+
${{ runner.os }}-yarn-
72+
73+
- name: Install dependencies
74+
run: yarn
75+
76+
- name: Deploy to Vercel if needed
77+
run: |
78+
npm install --global vercel@latest
79+
vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
80+
vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
81+
vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

0 commit comments

Comments
 (0)