Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: deployment action for all applications #3605

Merged
merged 31 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
165e055
chore: bootstrap releases for path: .
shoom3301 Jan 10, 2024
6557829
chore: release-please monorepo
shoom3301 Jan 10, 2024
2c0a5c6
chore: remove cowswap changelog
shoom3301 Jan 10, 2024
5ef1d6a
chore: set bootstrap-sha
shoom3301 Jan 10, 2024
9082c5e
chore: set last-release-sha
shoom3301 Jan 10, 2024
7bc2113
chore: set release-search-depth
shoom3301 Jan 10, 2024
d1c90d2
chore: set release-search-depth
shoom3301 Jan 10, 2024
61b9b45
chore: set bootstrap-sha
shoom3301 Jan 10, 2024
6b286f9
fix(permit-utils): use const for default permit gas limit
shoom3301 Jan 10, 2024
e729e16
chore: update package json paths
shoom3301 Jan 10, 2024
4d22b1b
chore: set release-search-depth
shoom3301 Jan 10, 2024
266477c
chore: set release-search-depth
shoom3301 Jan 10, 2024
476ef7d
chore: set release-search-depth
shoom3301 Jan 10, 2024
b1212d8
chore: set bootstrap-sha
shoom3301 Jan 10, 2024
2ecf115
chore: set bootstrap-sha
shoom3301 Jan 10, 2024
052b26b
chore: set bootstrap-sha
shoom3301 Jan 10, 2024
9840ec3
chore: set bootstrap-sha
shoom3301 Jan 10, 2024
3996183
chore: set last-release-sha
shoom3301 Jan 10, 2024
a8ff453
chore: more libs
shoom3301 Jan 10, 2024
adde6e3
ci: deployment action for all applications
shoom3301 Jan 10, 2024
918da26
Merge branch 'develop' of https://github.com/cowprotocol/cowswap into…
shoom3301 Jan 11, 2024
e55b16b
chore: fix desc
shoom3301 Jan 11, 2024
fb57666
Merge branch 'test-rp' of https://github.com/cowprotocol/cowswap into…
shoom3301 Jan 11, 2024
3be22c5
chore: fix project_suffix
shoom3301 Jan 11, 2024
9cf2afa
chore: fix desc
shoom3301 Jan 11, 2024
939dcc7
Merge branch 'develop' of https://github.com/cowprotocol/cowswap into…
shoom3301 Jan 11, 2024
39f4287
chore: add env vars for Explorer
shoom3301 Jan 11, 2024
e5e6541
chore: fix comment
shoom3301 Jan 11, 2024
21f9dc2
chore: fix sentry vars
shoom3301 Jan 11, 2024
9d403d6
chore: fix comments
shoom3301 Jan 11, 2024
b124a38
chore: remove unused var
shoom3301 Jan 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ on:
branches: [main, develop]
tags: [v*]
workflow_dispatch: # Manually trigger it via UI/CLI/API
inputs:
app:
description: App to deploy
required: true
type: choice
options:
- COWSWAP
- EXPLORER
- ALL

jobs:

Expand All @@ -17,6 +26,7 @@ jobs:
secrets: inherit
with:
env_name: dev
app: ALL

vercel-pre-prod:
# Deploys to Vercel staging and barn environments
Expand All @@ -29,6 +39,7 @@ jobs:
env_name: [barn, staging] # deploys both in parallel
with:
env_name: ${{ matrix.env_name }}
app: ALL

vercel-prod:
# Deploys to Vercel prod environment
Expand All @@ -38,3 +49,4 @@ jobs:
secrets: inherit
with:
env_name: prod
app: ${{ inputs.app }}
18 changes: 17 additions & 1 deletion .github/workflows/vercel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
description: 'Environment to deploy to. Options are: dev, staging, barn and prod'
required: true
type: string
app:
description: 'Application to deploy. Options are: ALL, COWSWAP, EXPLORER'
required: true
type: string

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
Expand All @@ -17,13 +21,17 @@ jobs:
environment: ${{ inputs.env_name }} # Environment rules defined on GH UI
concurrency: ${{ inputs.env_name }} # Only one run per env at a time

strategy:
matrix:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool!

project_suffix: ${{ inputs.app == 'ALL' && [COWSWAP, EXPLORER] || [input.app] }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this we will need some process to add a new app, to remember to do all the steps

  • add app in mono
  • vercel setup
  • edit here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add a process to notion


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.VERCEL_PROJECT_ID }}" >> $GITHUB_ENV
run: echo "VERCEL_PROJECT_ID=${{ secrets[format('VERCEL_PROJECT_ID_{0}', matrix.project_suffix)] }}" >> $GITHUB_ENV
shoom3301 marked this conversation as resolved.
Show resolved Hide resolved

- name: Install Vercel CLI
run: npm install --global vercel@latest
Expand All @@ -33,6 +41,7 @@ jobs:

- name: Build Project Artifacts
run: >
: # CoWSwap env vars
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 }}
Expand All @@ -45,6 +54,13 @@ jobs:
REACT_APP_NETWORK_URL_5=${{ secrets.REACT_APP_NETWORK_URL_5 }}
REACT_APP_NETWORK_URL_11155111=${{ secrets.REACT_APP_NETWORK_URL_11155111 }}
REACT_APP_WC_PROJECT_ID=${{ secrets.REACT_APP_WC_PROJECT_ID }}
: # Explorer env vars
REACT_APP_IPFS_READ_URI=${{ secrets.REACT_APP_IPFS_READ_URI }}
REACT_APP_EXPLORER_SENTRY_DSN=${{ secrets.EXPLORER_SENTRY_DSN }}
REACT_APP_EXPLORER_GOOGLE_ANALYTICS_ID=${{ secrets.EXPLORER_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 }}
vercel build -t ${{ secrets.VERCEL_TOKEN }} --prod

- name: Get the version
Expand Down
4 changes: 1 addition & 3 deletions apps/explorer/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ AUTOCONNECT=true
REACT_APP_IPFS_READ_URI=https://cloudflare-ipfs.com/ipfs

# Sentry
#REACT_APP_SENTRY_DSN='https://<url>'
#REACT_APP_SENTRY_TRACES_SAMPLE_RATE="1.0"
#REACT_APP_SENTRY_AUTH_TOKEN='<sentry_auth_token>'
#REACT_APP_EXPLORER_SENTRY_DSN='https://<url>'

# Orderbook API Endpoints
#REACT_APP_ORDER_BOOK_URLS='{"1":"https://YOUR_HOST","100":"https://YOUR_HOST","5":"https://YOUR_HOST"}
2 changes: 1 addition & 1 deletion apps/explorer/src/components/analytics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getCLS, getFCP, getFID, getLCP, Metric } from 'web-vitals'

import GoogleAnalyticsProvider from './GoogleAnalyticsProvider'

const GOOGLE_ANALYTICS_ID: string | undefined = process.env.GOOGLE_ANALYTICS_ID
const GOOGLE_ANALYTICS_ID: string | undefined = process.env.REACT_APP_EXPLORER_GOOGLE_ANALYTICS_ID
export const GOOGLE_ANALYTICS_CLIENT_ID_STORAGE_KEY = 'ga_client_id'

const storedClientId = window.localStorage.getItem(GOOGLE_ANALYTICS_CLIENT_ID_STORAGE_KEY)
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/src/explorer/ExplorerApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { NetworkUpdater } from '../state/network/NetworkUpdater'
import { NETWORK_OPTIONS } from '../consts/network'
import { RedirectMainnet, RedirectXdai } from '../state/network'

const SENTRY_DSN = process.env.REACT_APP_SENTRY_DSN
const SENTRY_DSN = process.env.REACT_APP_EXPLORER_SENTRY_DSN
const SENTRY_TRACES_SAMPLE_RATE = process.env.REACT_APP_SENTRY_TRACES_SAMPLE_RATE

if (SENTRY_DSN) {
Expand Down
Loading