This repository has been archived by the owner on Feb 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
64 lines (53 loc) · 2.26 KB
/
vercel.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: Vercel
on:
workflow_call:
inputs:
env_name:
description: 'Environment to deploy to. Options are: dev, staging, barn and prod'
required: true
type: string
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
NODE_VERSION: lts/gallium
jobs:
build_and_deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.env_name }} # Environment rules defined on GH UI
concurrency: ${{ inputs.env_name }} # Only one run per env at a time
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
- name: Set VERCEL_PROJECT_ID env var
# It's set in each env's config on https://github.com/cowprotocol/explorer/settings/environments
run: echo "VERCEL_PROJECT_ID=${{ secrets.VERCEL_PROJECT_ID }}" >> $GITHUB_ENV
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: >
ETH_NODE_URL: ${{ secrets.ETH_NODE_URL }}
INFURA_ID: ${{ secrets.INFURA_ID }}
REACT_APP_IPFS_READ_URI=${{ secrets.REACT_APP_IPFS_READ_URI }}
REACT_APP_SENTRY_DSN=${{ secrets.SENTRY_DSN }}
REACT_APP_SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
GOOGLE_ANALYTICS_ID=${{ secrets.GOOGLE_ANALYTICS_ID }}
REACT_APP_SUBGRAPH_URL_MAINNET=${{ secrets.REACT_APP_SUBGRAPH_URL_MAINNET }}
REACT_APP_SUBGRAPH_URL_GNOSIS_CHAIN=${{ secrets.REACT_APP_SUBGRAPH_URL_GNOSIS_CHAIN }}
REACT_APP_SUBGRAPH_URL_GOERLI=${{ secrets.REACT_APP_SUBGRAPH_URL_GOERLI }}
APP_ID=1
vercel build -t ${{ secrets.VERCEL_TOKEN }} --prod
- name: Get the version
id: get_version
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT
- name: Deploy Project Artifacts to Vercel
run: >
vercel deploy --prebuilt --prod
-t ${{ secrets.VERCEL_TOKEN }}
-m VERSION=${{ steps.get_version.outputs.VERSION }}
-m COMMIT=${{ github.sha }}