Skip to content

Commit

Permalink
Merge branch 'dev' into feat/app-v2/phase-0
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinciarka committed May 27, 2024
2 parents 14190bd + 33b422b commit 86315cd
Show file tree
Hide file tree
Showing 82 changed files with 6,719 additions and 5,615 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/deploy-sdk-production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: 'Deploy SDK Production'

on:
workflow_dispatch:

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
deploy:
name: Build & Deploy SDK to production using SST
environment: production
runs-on: ubuntu-latest
env:
ONE_INCH_API_KEY: ${{ secrets.ONE_INCH_API_KEY }}
ONE_INCH_API_VERSION: ${{ secrets.ONE_INCH_API_VERSION }}
ONE_INCH_API_URL: ${{ secrets.ONE_INCH_API_URL }}
ONE_INCH_ALLOWED_SWAP_PROTOCOLS: ${{ secrets.ONE_INCH_ALLOWED_SWAP_PROTOCOLS }}
ONE_INCH_SWAP_CHAIN_IDS: ${{ secrets.ONE_INCH_SWAP_CHAIN_IDS }}
ONE_INCH_API_SPOT_URL: ${{ secrets.ONE_INCH_API_SPOT_URL }}
ONE_INCH_API_SPOT_VERSION: ${{ secrets.ONE_INCH_API_SPOT_VERSION }}
ONE_INCH_API_SPOT_KEY: ${{ secrets.ONE_INCH_API_SPOT_KEY }}
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
SUBGRAPH_BASE: ${{ secrets.SUBGRAPH_BASE }}
RPC_GATEWAY: ${{ secrets.RPC_GATEWAY }}
DEBANK_API_KEY: ${{ secrets.DEBANK_API_KEY }}
DEBANK_API_URL: ${{ secrets.PROD_DEBANK_API_URL }}
POWERTOOLS_LOG_LEVEL: ${{ vars.POWERTOOLS_LOG_LEVEL }}
REDIS_CACHE_URL: ${{ secrets.REDIS_CACHE_URL }}
REDIS_CACHE_USER: ${{ secrets.REDIS_CACHE_USER }}
REDIS_CACHE_PASSWORD: ${{ secrets.REDIS_CACHE_PASSWORD }}
VPC_ID: ${{ secrets.VPC_ID }}
SECURITY_GROUP_ID: ${{ secrets.SECURITY_GROUP_ID }}
RAYS_DB_WRITE_CONNECTION_STRING: ${{ secrets.RAYS_DB_WRITE_CONNECTION_STRING }}
RAYS_DB_READ_CONNECTION_STRING: ${{ secrets.RAYS_DB_READ_CONNECTION_STRING }}
steps:
- name: Git clone the repository
uses: actions/checkout@v3

- name: Cache turbo build setup
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- uses: pnpm/action-setup@v2.0.1
with:
version: 8.14.1

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Install dependencies
run: pnpm install

- name: Prebuild
run: pnpm prebuild

- name: Build
run: pnpm build

- name: Deploy app
run: |
pnpm run sst:deploy:sdk:prod
76 changes: 76 additions & 0 deletions .github/workflows/deploy-sdk-staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: 'Deploy SDK Staging'

on:
workflow_dispatch:

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
deploy:
name: Build & Deploy SDK to staging using SST
environment: staging
runs-on: ubuntu-latest
env:
ONE_INCH_API_KEY: ${{ secrets.ONE_INCH_API_KEY }}
ONE_INCH_API_VERSION: ${{ secrets.ONE_INCH_API_VERSION }}
ONE_INCH_API_URL: ${{ secrets.ONE_INCH_API_URL }}
ONE_INCH_ALLOWED_SWAP_PROTOCOLS: ${{ secrets.ONE_INCH_ALLOWED_SWAP_PROTOCOLS }}
ONE_INCH_SWAP_CHAIN_IDS: ${{ secrets.ONE_INCH_SWAP_CHAIN_IDS }}
ONE_INCH_API_SPOT_URL: ${{ secrets.ONE_INCH_API_SPOT_URL }}
ONE_INCH_API_SPOT_VERSION: ${{ secrets.ONE_INCH_API_SPOT_VERSION }}
ONE_INCH_API_SPOT_KEY: ${{ secrets.ONE_INCH_API_SPOT_KEY }}
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
SUBGRAPH_BASE: ${{ secrets.SUBGRAPH_BASE }}
RPC_GATEWAY: ${{ secrets.RPC_GATEWAY }}
DEBANK_API_KEY: ${{ secrets.DEBANK_API_KEY }}
DEBANK_API_URL: ${{ secrets.STAGING_DEBANK_API_URL }}
POWERTOOLS_LOG_LEVEL: ${{ vars.POWERTOOLS_LOG_LEVEL }}
REDIS_CACHE_URL: ${{ secrets.REDIS_CACHE_URL }}
REDIS_CACHE_USER: ${{ secrets.REDIS_CACHE_USER }}
REDIS_CACHE_PASSWORD: ${{ secrets.REDIS_CACHE_PASSWORD }}
VPC_ID: ${{ secrets.VPC_ID }}
SECURITY_GROUP_ID: ${{ secrets.SECURITY_GROUP_ID }}
RAYS_DB_WRITE_CONNECTION_STRING: ${{ secrets.RAYS_DB_WRITE_CONNECTION_STRING }}
RAYS_DB_READ_CONNECTION_STRING: ${{ secrets.RAYS_DB_READ_CONNECTION_STRING }}
steps:
- name: Git clone the repository
uses: actions/checkout@v3

- name: Cache turbo build setup
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- uses: pnpm/action-setup@v2.0.1
with:
version: 8.14.1

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
# role-duration-seconds: 14390 #adjust as needed for your build time
aws-region: ${{ secrets.AWS_REGION }}

- name: Install dependencies
run: pnpm install

- name: Prebuild
run: pnpm prebuild

- name: Build
run: pnpm build

- name: Deploy app
run: |
pnpm run sst:deploy:sdk:staging
Loading

0 comments on commit 86315cd

Please sign in to comment.