-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/add-chart-ui
- Loading branch information
Showing
180 changed files
with
3,845 additions
and
3,123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
node_modules/ | ||
|
||
# build | ||
**/dist/ | ||
**/build/ | ||
|
||
.git/ | ||
.github/ | ||
.vscode/ | ||
|
||
|
||
**/coverage/ | ||
npm-debug.log | ||
.coverage | ||
.coverage.* | ||
.aws | ||
.husky | ||
.nx | ||
**/target | ||
**/pkg | ||
**/tests | ||
*.md | ||
|
||
# docker | ||
Dockerfile* | ||
|
||
# env variables | ||
**/.env.* | ||
**/.env | ||
|
||
# config | ||
config*.{yaml,yml} | ||
|
||
# database file | ||
**/*.db | ||
**/*.wal | ||
oraidex-sync-data* | ||
**/*.csv | ||
**/*.txt | ||
|
||
|
||
# prettier | ||
.prettierc.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PORT=2024 | ||
RPC_URL=https://rpc.orai.io | ||
LIMIT=1000 | ||
MAX_THREAD_LEVEL=3 | ||
DUCKDB_PROD_FILENAME="db_name" | ||
DUCKDB_FILENAME="db_name_only_sync" | ||
INITIAL_SYNC_HEIGHT=14612180 | ||
ORDERBOOK_API_ENDPOINT=https://server.oraidex.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Check the test before merge | ||
|
||
on: | ||
# When Release Pull Request is merged | ||
pull_request: | ||
types: [opened, synchronize] | ||
branches: | ||
- main | ||
- staging | ||
|
||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
node: ["18.18.0"] | ||
os: ["ubuntu-latest"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Nodejs | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- run: npm install -g yarn | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | ||
|
||
- uses: actions/cache@v3 | ||
id: yarn-cache | ||
with: | ||
path: | | ||
${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
./node_modules/ | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install Dependencies | ||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
run: yarn | ||
|
||
- name: Run nx reset workspace | ||
run: yarn nx reset | ||
|
||
- name: Run build | ||
run: yarn build | ||
|
||
- name: Run test | ||
run: | | ||
yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
name: Build and push executor to Docker Hub | ||
|
||
on: | ||
workflow_dispatch: | ||
branches: | ||
- main | ||
- staging | ||
|
||
push: | ||
tags: | ||
- "v*" | ||
- "v*-beta" | ||
|
||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
jobs: | ||
docker: | ||
strategy: | ||
matrix: | ||
node: ["18.18.0"] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
oraichain/defi_oraidex-backend | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=sha,enable=true,priority=100,prefix=,suffix=,format=short | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
build-args: | | ||
GIT_COMMIT=${{ env.GIT_COMMIT }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
context: . | ||
cache-from: type=registry,ref=oraichain/defi_oraidex-backend:buildcache | ||
cache-to: type=registry,ref=oraichain/defi_oraidex-backend:buildcache,mode=max | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
swarm: | ||
runs-on: ubuntu-20.04 | ||
needs: docker | ||
steps: | ||
- name: Extract SHA | ||
id: extract_sha | ||
run: echo "short_sha=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_OUTPUT | ||
|
||
- name: Check outputs | ||
run: echo ${{ steps.extract_sha.outputs.short_sha}} | ||
|
||
- name: Set environment | ||
id: set_environment | ||
env: | ||
GITHUB_REF_NAME: ${{ github.ref_name }} | ||
run: | | ||
set -e | ||
if [[ $GITHUB_REF_NAME == 'main' || ! $GITHUB_REF_NAME =~ 'beta' ]] | ||
then | ||
echo deploy_environment='production' >> $GITHUB_OUTPUT | ||
else | ||
echo deploy_environment='staging' >> $GITHUB_OUTPUT; | ||
fi | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Check exist images | ||
run: | | ||
docker manifest inspect oraichain/defi_oraidex-backend:${{ steps.extract_sha.outputs.short_sha }} | ||
- name: Deploy to Swarm (staging) | ||
if: ${{ steps.set_environment.outputs.deploy_environment == 'staging'}} | ||
run: | | ||
curl -X POST \ | ||
${{ secrets.STAGING_WEBHOOK_SERVICE }}?tag=${{ steps.extract_sha.outputs.short_sha }} | ||
- name: Deploy to Swarm | ||
if: ${{ steps.set_environment.outputs.deploy_environment == 'production'}} | ||
run: | | ||
curl -X POST \ | ||
${{ secrets.WEBHOOK_SERVICE }}?tag=${{ steps.extract_sha.outputs.short_sha }} | ||
- name: Send discord message | ||
uses: appleboy/discord-action@master | ||
with: | ||
webhook_id: ${{ secrets.WEBHOOK_ID }} | ||
webhook_token: ${{ secrets.WEBHOOK_TOKEN }} | ||
username: "GitBot" | ||
message: "[${{ steps.set_environment.outputs.deploy_environment }}] Repo oraidex-backend has just deployed to swarm with tag: ${{ steps.extract_sha.outputs.short_sha }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,5 @@ build | |
dist | ||
.DS_Store | ||
cache/ | ||
|
||
packages/contract-state-simulate/public/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
{ | ||
"prettier.singleQuote": false, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": false, | ||
"prettier.useEditorConfig": false, | ||
"prettier.useTabs": false, | ||
"prettier.trailingComma": "none", | ||
"prettier.jsxSingleQuote": false, | ||
"prettier.tabWidth": 2, | ||
"prettier.printWidth": 120, | ||
"prettier.semi": true, | ||
"prettier.singleQuote": true, | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
Oops, something went wrong.