-
Notifications
You must be signed in to change notification settings - Fork 101
73 lines (63 loc) · 3.27 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
65
66
67
68
69
70
71
72
73
name: Vercel
on:
workflow_call:
inputs:
env_name:
description: 'Environment to deploy to. Options are: dev, staging, barn and prod'
required: true
type: string
app:
description: 'Application to deploy. Options are: COWSWAP, EXPLORER'
required: true
type: string
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
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 VERCEL_PROJECT_ID env var
# It's set in each env's config on https://github.com/cowprotocol/cowswap/settings/environments
run: echo "VERCEL_PROJECT_ID=${{ secrets[format('VERCEL_PROJECT_ID_{0}', inputs.app)] }}" >> $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: >
REACT_APP_SENTRY_DSN=${{ secrets.SENTRY_DSN }}
REACT_APP_PINATA_API_KEY=${{ secrets.REACT_APP_PINATA_API_KEY }}
REACT_APP_PINATA_SECRET_API_KEY=${{ secrets.REACT_APP_PINATA_SECRET_API_KEY }}
REACT_APP_BLOCKNATIVE_API_KEY=${{ secrets.REACT_APP_BLOCKNATIVE_API_KEY }}
REACT_APP_GOOGLE_ANALYTICS_ID=${{ secrets.REACT_APP_GOOGLE_ANALYTICS_ID }}
REACT_APP_LAUNCH_DARKLY_KEY=${{ secrets.REACT_APP_LAUNCH_DARKLY_KEY }}
REACT_APP_INFURA_KEY=${{ secrets.REACT_APP_INFURA_KEY }}
REACT_APP_NETWORK_URL_1=${{ secrets.REACT_APP_NETWORK_URL_1 }}
REACT_APP_NETWORK_URL_100=${{ secrets.REACT_APP_NETWORK_URL_100 }}
REACT_APP_NETWORK_URL_42161=${{ secrets.REACT_APP_NETWORK_URL_42161 }}
REACT_APP_NETWORK_URL_8453=${{ secrets.REACT_APP_NETWORK_URL_8453 }}
REACT_APP_NETWORK_URL_11155111=${{ secrets.REACT_APP_NETWORK_URL_11155111 }}
REACT_APP_WC_PROJECT_ID=${{ secrets.REACT_APP_WC_PROJECT_ID }}
REACT_APP_IPFS_READ_URI=${{ secrets.REACT_APP_IPFS_READ_URI }}
REACT_APP_EXPLORER_SENTRY_DSN=${{ secrets.EXPLORER_SENTRY_DSN }}
REACT_APP_SUBGRAPH_URL_MAINNET=${{ secrets.REACT_APP_SUBGRAPH_URL_MAINNET }}
REACT_APP_SUBGRAPH_URL_ARBITRUM_ONE=${{ secrets.REACT_APP_SUBGRAPH_URL_ARBITRUM_ONE }}
REACT_APP_SUBGRAPH_URL_BASE=${{ secrets.REACT_APP_SUBGRAPH_URL_BASE }}
REACT_APP_SUBGRAPH_URL_GNOSIS_CHAIN=${{ secrets.REACT_APP_SUBGRAPH_URL_GNOSIS_CHAIN }}
REACT_APP_BFF_BASE_URL=${{ secrets.BFF_BASE_URL }}
REACT_APP_CMS_BASE_URL=${{ secrets.CMS_BASE_URL }}
NEXT_PUBLIC_CMS_BASE_URL=${{ secrets.CMS_BASE_URL }}
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 }}