Skip to content

Commit

Permalink
Update testnet (#462)
Browse files Browse the repository at this point in the history
* Hotfix positions rate limit (#418)

* remove balance timestamp dependency

* fix order percent decimal error

* remove "DEX" on broker name

* fix ws connection by change socket url

* update refresh mechanism

* update handleVisibilityChange

* set unvisible mechanism

* fix ws timeout error

* remove ws log

* update ws reconnect logic

* add detect pathname

* add detect on portfolio page

* set shouldReconnect to be true

* add visibilitychange detect on mobile device

---------

Co-authored-by: Max <[email protected]>

* Hotfix null brokername (#420)

* replace null broker_name to String

* fix mobile style

* change replaced name

* remove from text when broker_name is null

---------

Co-authored-by: Max <[email protected]>

* Add new stable pool (#421)

* add new stable pool

* add new banner

* add new color for native stable token

* testnet

* update config

* fix hybrid smart routing bug

* fix bugs

* update ui

* sort pool

* fix new usdt symbol

* add new config file for native token

* optimizaation

* optimization

* update banner img

* update delay

* optimize the copy effect  for account id

* show pr3sence

* recover new stable pool

* update native usdc register and deposit logic

* remove log

* catch smart routing algorithm error

* remove log

* remove console log

---------

Co-authored-by: nature.xie <[email protected]>
Co-authored-by: Max <[email protected]>

* Add link for farm advertisement (#422)

* add link for new farm

* add cursor pointer

---------

Co-authored-by: nature.xie <[email protected]>

* update farm config (#424)

Co-authored-by: nature.xie <[email protected]>

* Config reduce only (#425)

* add reduce_only config

* compare to get best estimate

* update smart routing

* update configV2.ts

* fix symbol orderbook price error

* remove ref bot

* remove console log

---------

Co-authored-by: Max <[email protected]>
Co-authored-by: nature.xie <[email protected]>

* Filesize optimize (#427)

* reduce css bundle size

* optimized react-icons import

* svg code to svg file part 1

* svg code to file part 2

* svg code to file part 3

* merge main to this branch (#423)

* Add new stable pool (#421)

* add new stable pool

* add new banner

* add new color for native stable token

* testnet

* update config

* fix hybrid smart routing bug

* fix bugs

* update ui

* sort pool

* fix new usdt symbol

* add new config file for native token

* optimizaation

* optimization

* update banner img

* update delay

* optimize the copy effect  for account id

* show pr3sence

* recover new stable pool

* update native usdc register and deposit logic

* remove log

* catch smart routing algorithm error

* remove log

* remove console log

---------

Co-authored-by: nature.xie <[email protected]>
Co-authored-by: Max <[email protected]>

* Add link for farm advertisement (#422)

* add link for new farm

* add cursor pointer

---------

Co-authored-by: nature.xie <[email protected]>

---------

Co-authored-by: Joe Zhu <[email protected]>
Co-authored-by: nature.xie <[email protected]>
Co-authored-by: Max <[email protected]>

* reduce css bundle size

* optimized react-icons import

* svg code to svg file part 1

* svg code to file part 2

* svg code to file part 3

* debounce swap amount input (#426)

* run prettier:fix

* jest test svg

* fix import

* update react-icons allfile version

* disable button on amount changed

* fix switch token in out

* reduce debounce period

* fix 0 show loading

* fix alert msg

* update svg

* update yarnlock

---------

Co-authored-by: Yuho <[email protected]>
Co-authored-by: yuhochu <[email protected]>
Co-authored-by: nature.xie <[email protected]>
Co-authored-by: Max <[email protected]>

* update xref data (#428)

Co-authored-by: nature.xie <[email protected]>

* update booster from x2 to x1 (#429)

Co-authored-by: nature.xie <[email protected]>

* Upgrade native usdc (#430)

* updated native usdc register logic

* update

* update

---------

Co-authored-by: nature.xie <[email protected]>

* handle remove liquidity for ledger (#431)

Co-authored-by: nature.xie <[email protected]>

* Add gzip (#432)

* zip

* add gzip

---------

Co-authored-by: Gavin <[email protected]>

* Update orderly tip (#433)

* update orderly tip

* update font size

* add tip on spot page

---------

Co-authored-by: nature.xie <[email protected]>

* update gzip (#434)

* Code split craco (#435)

* code split & parcel -> carco

* fix favicon

* fix routes and fonts

* fix ani

* fix load fonts

* fix near-api-js to 0.44.2

* fix jest

* fix jest and prettier

---------

Co-authored-by: Gavin <[email protected]>

* Change usdc to usdc.e (#436)

* change usdc to usdc.e in orderly page

* update usdc to usdc.e

* fix  Maintenance Margin Ratio field issue

* remove log

* update text in Spot page

* fix block problem

* fix ledger display issue

* update totalCollateral logic

* fix ledger select accout too long issue

* remove price board

* remove advertisement

* fix env

* reset TotalCollateral logic

* add USDC.e Available Balance

* reset orderly tip

* update ui in mobile site

* update text

---------

Co-authored-by: nature.xie <[email protected]>
Co-authored-by: Gavin <[email protected]>

* Dcl upgrade (#437)

* add recent transactions template

* add classic pool recent transactions

* update recent transactions table

* fix pool transactions ui

* add pool top bin apr

* add top bin apr in pool list

* add grouped your liquidity

* add liquidity chart

* add demo

* update return value of getDclPoolPoints

* update

* update add liquidity page

* update package.json

* add batch_add_liquidity api

* add user chart

* fix conflict

* add remove chart

* update e.g.

* update remove liquidity style

* just for test

* update

* update

* add dcl farm

* update dcl farm

* add order chart

* update

* update

* update

* fix swap bug

* add limit order check storage function

* fix bugs

* update code for tester

* update

* update

* update order chart

* add liquidity

* add your liquidity chart

* add liquidity

* add remove liquidity function

* update add liquidity page

* add slider for remove liquidity

* add slider for add and remove function

* fix bug

* fix bugs

* update

* add personal chart data

* add user chart

* add user 24 fee apr

* add user chart hover data

* fix storage issue

* update

* update

* add small chart

* update

* add recent log in table pool

* fix bugs

* update

* update

* update

* update

* update

* optimize

* update

* fix bug

* fix bug

* update

* update1

* fix bugs

* update

* update

* fix bugs

* update

* fix bugs

* update your liquidity

* update your liquidity page

* update

* update ui

* update color

* update

* update

* fix bug

* fix bug

* update the name of a function

* update

* update

* update

* update

* update

* update icon

* fix bug

* update

* fix bug

* update

* update

* add log

* add log

* add reverse logic

* fix bugs

* fix bug

* fix bug

* fix bug

* add reverse processing

* update yarn.lock

* fix bugs about the order of tokens

* update to batch interface

* compelete function

* handle call back of transition

* update top bin apr logic

* fix ui issue

* update add liquidity ui

* update ui issue

* fix ui bug

* fix ui bug

* fix bugs

* fix bug

* fix bugs

* optimization

* update

* fix bug

* update mobile ui

* add mobile style

* fix bugs

* update

* split code

* update

* fix bug

* fix bugs

* fix bugs

* fix bugs

* fix bugs

* update style

* fix bugs

* optimization

* fix bugs

* add tip when too much token amount be entered

* fix bugs

* fix bugs

* fix bugs

* fix bugs

* update

* fix bugs

* fix bugs

* optimization

* optimizatio

* optimization

* optimization

* add Recent Transactions for fourTokenPool

* ui optimization

* add Recent Transactions for two token stable pool

* fix bugs

* add new dcl log

* ui optimization

* add log and update dcl config

* add log

* add log

* fix tailwind issue

* update

* update

* update

* fix ui issue

* fix bugs

* optimization

* add sort for top bin apr

* split batch function for some wallet

* modify the wallet selector versions

* upgrated near-wallet-selector

* update neth wallet version

* handle neth wallet issue

* fix ui issue

* update for here-wallet

* fix here wallet issue

* update

* fix issue

* add test code

* remove test code

* update

* fix batch update

* fix ledger issue for batch opration in farm page

* add test code

* add test code

* add test code for batch_add

* update

* fix here wallet batch transtion error

* upgrade rxjs versions

* add farm apr for dcl pool list

* update text for watchList in mobile site

* modal ui use package

* change wallet custom  ui to standard Ui

* update z-index

* update wallet select ui

* add apr for stable pool

* update craco.config.cjs

* add webpack-retry-chunk-load-plugin

* update

* fix batch add issue for legder

* fix ui issue for ledger

* fix ui issue

* fix ve pool display issue

* remove log

* test

* fix v1 pool display issue

* fix mobile ui issue

* fix ui

* update font size

---------

Co-authored-by: Max <[email protected]>
Co-authored-by: nature.xie <[email protected]>
Co-authored-by: Gavin <[email protected]>

* Perf/smart router logic (#438)

* perf: optimize smartRouteLogic using web worker

* fix: comlink replaces comlink-loader to solve the problem that webpack5 is not supported

* fix: swap router format near metadata

* fix: swap token exchange alert

* fix: remove console

* fix: jest test error

---------

Co-authored-by: harry <[email protected]>

* Update deploy-aws-us.yml

123

* Update tests.yml

* Update deploy-aws-us.yml

123

* Update deploy-aws-us.yml

* Add orderbook hostname (#440)

* update route

* add /swap route for orderbook hostname

* fix menu jump issue

* fix menu issue

* fix menu issue in mobile site

* collatteral usdc.e handle

* chore: 暂时隐藏perf/smart-router-logic 相关优化

* remove comlink

---------

Co-authored-by: nature.xie <[email protected]>
Co-authored-by: harry <[email protected]>

* fix available issue (#441)

Co-authored-by: nature.xie <[email protected]>

* fix hostname issue (#442)

Co-authored-by: nature.xie <[email protected]>

* Sprint2 (#443)

* show under maintenance when interface is bad

* update ui

* update orderly field

* implement Google Analysis 4

* withdraw DCL & ref classic

* feat: footer add security link

* icon and tooltip

* feat: mobile footer add security link

* add pagination to top pools

* Revert "add pagination to top pools"

This reverts commit 3b82421.

* update column

* hide your liquidity menu

* connect wallet risk modal

* update

* fix zindex

* Google Analytics Terms of Service

* update ui

* update ga ui

* responsive color

* fix key warning

* mobile ref dcl aurora withdraw

* update ga ui

* fix zindex

* close button ui

* remove pools col

* remove ga

* fix icon issue

* fix icon issue

* remove pr3sence advertisement

---------

Co-authored-by: nature.xie <[email protected]>
Co-authored-by: Yuho <[email protected]>
Co-authored-by: harry <[email protected]>

* Perf/smart router logic (#444)

* perf: optimize smartRouteLogic using web worker

* fix: comlink replaces comlink-loader to solve the problem that webpack5 is not supported

* fix: swap router format near metadata

* fix: swap token exchange alert

* fix: remove console

* fix: jest test error

---------

Co-authored-by: harry <[email protected]>

* Update deploy-aws-us.yml

update cicd

* Hotfix frozen meta token (#445)

* add meta token to black list

* update BLACKLIST_POOL_IDS config

---------

Co-authored-by: nature.xie <[email protected]>

* Orderly unavailable tip (#446)

* replace at

* update orderly tip

* always show

* farm apy optimization

* update tip

---------

Co-authored-by: yuho <[email protected]>
Co-authored-by: nature.xie <[email protected]>

* Feature/ref 5260 (#447)

* fix: decimals leads to exchange failure problem

* feat: add console log swap smart route logic result

* chore: remove swap smart route result log

---------

Co-authored-by: harry <[email protected]>

* Deploy/docker (#450)

* deploy: docker related configuration

* deploy: dockerfile add BUILD_ENV

* Update and rename deploy-aws-us.yml to deploy-aws-us-docker.yml

* Update README.md

---------

Co-authored-by: caozm599 <[email protected]>

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker.yml

* recover orderly tip (#451)

Co-authored-by: nature.xie <[email protected]>

* Sprint3 google (#453)

* google analytics

* remove abandoned router

* transaction toast

* remove useless logic

* orderly button and deposit near optimization

* add and remove liquidity success / reject transaction toast

* pools tip

* react tooltip 5

* cleanup

* standardize tooltip component

* pretty fix

* click to refresh estimate price

(cherry picked from commit 2083c3d)

* fix import and quoting

* add clear warn on button for widthdraw function

* remove view-dcl-pool link

* swap transaction submitting, cancel, error, success modal

* fix array key warning

* handle mynearwallet toast message

* trigger balance to display in orderly page

* update near balance logic

* trigger balances

* update ui

* update auto refresh quoting

* refactor MobileLiduidityPage components

* fix

* pools tooltip

* transaction modal update

* update top pools to pools

* update top pools top pools

* fix ui

* upgrade ledger versions to latest

* Revert "transaction modal update"

This reverts commit 0f65b5c.

* Revert "handle mynearwallet toast message"

This reverts commit 9fb4550.

* Revert "swap transaction submitting, cancel, error, success modal"

This reverts commit b1cb0e9.

* revert

* revert toast

* hide topbintooltip

* remove unuse import

* hotfix

* hotfix

* shelter fixed

* fix tooltip begin hidden

* fix modal issue

* fix farm apr display issue in stable pool

* feat: webpack chunks split rules

* fix: nginx config

* update eslint rule

* remove log

---------

Co-authored-by: yuho <[email protected]>
Co-authored-by: nature.xie <[email protected]>
Co-authored-by: harry <[email protected]>

* Add tip for meta (#454)

* update

* add tip for meta token

* fix tip issue

* deploy: docker related configuration

* deploy: dockerfile add BUILD_ENV

* Update and rename deploy-aws-us.yml to deploy-aws-us-docker.yml

* Update README.md

* update tip content

* update yarn.lock

---------

Co-authored-by: nature.xie <[email protected]>
Co-authored-by: harry <[email protected]>
Co-authored-by: caozm599 <[email protected]>

* Google analytic (#455)

* google analytics

* ga4

* prettier

* remove log

---------

Co-authored-by: yuho <[email protected]>

* Add dcl pools (#456)

* add dcl config for limit order function

* update config

* hide only for limit order link

* update config

* add white list for limit order

* update fee tiers for limit order

* update dev config

---------

Co-authored-by: nature.xie <[email protected]>

* forzen meta token and limit pem token (#457)

Co-authored-by: nature.xie <[email protected]>

* Add dcl pools for limit order (#458)

* update config

* fix number handle issue

---------

Co-authored-by: nature.xie <[email protected]>

* Create deploy-aws-us-docker-update-v2.yml

* Update README.md

* Update deploy-aws-us-docker-update-v2.yml

* Update README.md

* Update deploy-aws-us-docker-update-v2.yml

* Update deploy-aws-us-docker.yml

* Update deploy-aws-us-docker-update-v2.yml

* update readme.md file (#460)

Co-authored-by: nature.xie <[email protected]>

* Update perp tip (#461)

* update near reservation in swap mode

* update near tip

* update translation

* update 0.5 near gas to 0.1 near gas on swap

* update orderly tip

* update 0.05near to 0.2near

---------

Co-authored-by: nature.xie <[email protected]>

---------

Co-authored-by: Max <[email protected]>
Co-authored-by: nature.xie <[email protected]>
Co-authored-by: Yuho <[email protected]>
Co-authored-by: yuhochu <[email protected]>
Co-authored-by: JoeAtRef <[email protected]>
Co-authored-by: Gavin <[email protected]>
Co-authored-by: GavinChen8914 <[email protected]>
Co-authored-by: harry <[email protected]>
Co-authored-by: caozm599 <[email protected]>
  • Loading branch information
10 people authored Jan 3, 2024
1 parent 50dd586 commit 8a379a1
Show file tree
Hide file tree
Showing 394 changed files with 53,504 additions and 26,941 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"@emotion",
"@babel/plugin-proposal-optional-chaining"
]
}
}
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dist
build
node_modules
.env.*.local
.git
.gitignore
.github
.vscode
49 changes: 49 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
// Allows for the parsing of JSX
jsx: true,
},
},
settings: {
react: {
version: 'detect',
},
},
ignorePatterns: [
'.DS_Store',
'.idea/',
'.vscode/',
'package-lock.json',
'yarn.lock',
'node_modules',
],
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'prettier',
'plugin:prettier/recommended',
],
plugins: ['simple-import-sort', 'unused-imports'],
rules: {
'unused-imports/no-unused-imports': 'off',
'simple-import-sort/imports': 'off',
'simple-import-sort/exports': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'prettier/prettier': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
'react/react-in-jsx-scope': 'off',
'object-shorthand': ['error', 'always'],
'dot-notation': 'error',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-types': 'off',
},
};
85 changes: 85 additions & 0 deletions .github/workflows/deploy-aws-us-docker-update-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Docker Build and Push deploy

on:
push:
branches:
- main

jobs:
build-and-push-deploy:
runs-on: ubuntu-latest

env:
IMAGE_TAG: ${{ github.run_number }}
ECR_REPOSITORY: ref-ui

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_V2 }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_V2 }}
aws-region: us-east-1

- name: Login to Amazon ECR
run: |
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 151564965346.dkr.ecr.us-east-1.amazonaws.com
- name: Build Docker image
run: |
docker build -t 151564965346.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} .
- name: Push Docker image
run: |
docker push 151564965346.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
- name: Execute SSH commmands on remote server[52.54.49.247]
uses: appleboy/ssh-action@master
with:
host: 52.54.49.247
username: root
key: ${{ secrets.SSH_PRIVATE_KEY_PROD_01 }}
port: 60022
script: |
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 151564965346.dkr.ecr.us-east-1.amazonaws.com
docker stop ref-ui || true
docker rm ref-ui || true
docker pull 151564965346.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
timeout=300
elapsed=0
while ! docker pull 151564965346.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} | grep -q "Image is up to date"; do
sleep 10
elapsed=$((elapsed+10))
if [ "$elapsed" -ge "$timeout" ]; then
echo "Timeout waiting for Docker pull."
exit 1
fi
done
docker run -d -p 8080:80 --name ref-ui 151564965346.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
- name: Execute SSH commmands on remote server[34.224.251.142]
uses: appleboy/ssh-action@master
with:
host: 34.224.251.142
username: root
key: ${{ secrets.SSH_PRIVATE_KEY_PROD_02 }}
port: 60022
script: |
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 151564965346.dkr.ecr.us-east-1.amazonaws.com
docker stop ref-ui || true
docker rm ref-ui || true
docker pull 151564965346.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
timeout=300
elapsed=0
while ! docker pull 151564965346.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} | grep -q "Image is up to date"; do
sleep 10
elapsed=$((elapsed+10))
if [ "$elapsed" -ge "$timeout" ]; then
echo "Timeout waiting for Docker pull."
exit 1
fi
done
docker run -d -p 8080:80 --name ref-ui 151564965346.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
85 changes: 85 additions & 0 deletions .github/workflows/deploy-aws-us-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Docker Build and Push deploy

on:
push:
branches:
- main-old-backup

jobs:
build-and-push-deploy:
runs-on: ubuntu-latest

env:
IMAGE_TAG: ${{ github.run_number }}
ECR_REPOSITORY: ref-ui

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Login to Amazon ECR
run: |
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 046257248069.dkr.ecr.us-east-1.amazonaws.com
- name: Build Docker image
run: |
docker build -t 046257248069.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} .
- name: Push Docker image
run: |
docker push 046257248069.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
- name: Execute SSH commmands on remote server[44.202.226.33]
uses: appleboy/ssh-action@master
with:
host: 44.202.226.33
username: root
key: ${{ secrets.SSH_PRIVATE_KEY_PROD_01 }}
port: 60022
script: |
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 046257248069.dkr.ecr.us-east-1.amazonaws.com
docker stop ref-ui || true
docker rm ref-ui || true
docker pull 046257248069.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
timeout=300
elapsed=0
while ! docker pull 046257248069.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} | grep -q "Image is up to date"; do
sleep 10
elapsed=$((elapsed+10))
if [ "$elapsed" -ge "$timeout" ]; then
echo "Timeout waiting for Docker pull."
exit 1
fi
done
docker run -d -p 8080:80 --name ref-ui 046257248069.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
- name: Execute SSH commmands on remote server[3.238.218.91]
uses: appleboy/ssh-action@master
with:
host: 3.238.218.91
username: root
key: ${{ secrets.SSH_PRIVATE_KEY_PROD_02 }}
port: 60022
script: |
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 046257248069.dkr.ecr.us-east-1.amazonaws.com
docker stop ref-ui || true
docker rm ref-ui || true
docker pull 046257248069.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
timeout=300
elapsed=0
while ! docker pull 046257248069.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} | grep -q "Image is up to date"; do
sleep 10
elapsed=$((elapsed+10))
if [ "$elapsed" -ge "$timeout" ]; then
echo "Timeout waiting for Docker pull."
exit 1
fi
done
docker run -d -p 8080:80 --name ref-ui 046257248069.dkr.ecr.us-east-1.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
98 changes: 0 additions & 98 deletions .github/workflows/deploy-aws-us.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Run Tests

on:
push:
branches: [main, dev]
branches: [dev]
pull_request:
branches: [main, dev]
branches: [dev]

jobs:
build:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package-lock.json
/out
.cache
.parcel-cache
parcel-bundle-reports

/dist

Expand All @@ -33,3 +34,4 @@ yarn-error.log*

.env
.idea
.vscode
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:16-alpine AS deps
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

FROM deps AS builder
ARG BUILD_ENV
# ARG BUILD_ENV= testnet | pub-testnet | mainnet
ENV BUILD_ENV $BUILD_ENV
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules

RUN if [ "$BUILD_ENV" = "testnet" ] ; then yarn build:testnet ; \
elif [ "$BUILD_ENV" = "pub-testnet" ] ; then yarn build:pub-testnet ; \
elif [ "$BUILD_ENV" = "mainnet" ] ; then yarn build:mainnet ; \
else yarn build ; fi


FROM nginx
RUN mkdir /app
COPY --from=builder /app/deploy/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /app/build /app/ref-ui

EXPOSE 80

CMD [ "nginx", "-g", "daemon off;" ]
Loading

0 comments on commit 8a379a1

Please sign in to comment.