Skip to content

Feature/add vercel analytics #177

Feature/add vercel analytics

Feature/add vercel analytics #177

name: Deploy Preview
on:
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
workflow_dispatch:
permissions: {}
jobs:
deploy-preview:
name: Deploy Preview
runs-on: ubuntu-latest
environment: preview
# Secrets are not available to forked PRs. Also, we don't want to deploy untrusted forks.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
permissions:
contents: read
deployments: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Deploy to Vercel (preview)
# v1.10.0
uses: BetaHuhn/deploy-to-vercel-action@9893d875c782e1b4995a9399e8c4d660c33849c3
with:
GITHUB_TOKEN: ${{ github.token }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ vars.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ vars.VERCEL_PROJECT_ID }}
PRODUCTION: false
GITHUB_DEPLOYMENT_ENV: Preview
CREATE_COMMENT: false
BUILD_ENV: |
PUBLIC_GOOGLE_MAPS_API_KEY="${{ vars.PUBLIC_GOOGLE_MAPS_API_KEY }}"
PUBLIC_SENTRY_DSN="${{ vars.PUBLIC_SENTRY_DSN }}"
PUBLIC_UPSTASH_SEARCH_REST_URL="${{ vars.PUBLIC_UPSTASH_SEARCH_REST_URL }}"
PUBLIC_UPSTASH_SEARCH_READONLY_TOKEN="${{ vars.PUBLIC_UPSTASH_SEARCH_READONLY_TOKEN }}"