Skip to content

Juno DEX

Juno DEX #28

name: Frontend deploy
on:
pull_request:
paths:
- "frontend/**"
- ".github/workflows/frontend_deploy.yml"
push:
branches:
- main
paths:
- "frontend/**"
- ".github/workflows/frontend_deploy.yml"
permissions:
contents: read
deployments: write
pull-requests: read
concurrency:
group: frontend-deploy-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
vercel:
name: Vercel preview/production
runs-on: ubuntu-latest
if: ${{ vars.VERCEL_ENABLED == 'true' }}
defaults:
run:
working-directory: frontend
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel environment
run: vercel pull --yes --environment=${{ github.event_name == 'push' && 'production' || 'preview' }} --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Vercel output
run: vercel build ${{ github.event_name == 'push' && '--prod' || '' }} --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Vercel output
run: vercel deploy --prebuilt ${{ github.event_name == 'push' && '--prod' || '' }} --token=${{ secrets.VERCEL_TOKEN }}