generated from Sceat/app-starter
-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (52 loc) · 1.88 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Deploy to Vercel
on:
push:
tags:
- 'mainnet-*'
- 'testnet-*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache Node.js modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Install Vercel CLI
run: npm install -g vercel
- name: Pull Vercel project settings
run: vercel pull --scope=aresrpg --yes --token ${{ secrets.VERCEL_TOKEN }}
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
- name: Build Vite project
run: npm run build
- name: Build Vercel output
run: vercel build
- name: Deploy to Vercel (Production)
if: startsWith(github.ref, 'refs/tags/mainnet-')
run: vercel deploy --scope=aresrpg --prebuilt --prod --token ${{ secrets.VERCEL_TOKEN }}
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
- name: Deploy to Vercel (Testnet)
if: startsWith(github.ref, 'refs/tags/testnet-')
run: |
url=$(vercel deploy --scope=aresrpg --prebuilt --token ${{ secrets.VERCEL_TOKEN }})
echo $url
vercel alias set $url testnet.aresrpg.world --scope=aresrpg --token ${{ secrets.VERCEL_TOKEN }}
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}