5.3.15 #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 for Production | |
if: startsWith(github.ref, 'refs/tags/mainnet-') | |
run: vercel build --prod --environment=production | |
- name: Build Vercel output for Testnet | |
if: startsWith(github.ref, 'refs/tags/testnet-') | |
run: vercel build --environment=preview | |
- 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 }} |