Skip to content

Commit

Permalink
add ci/cd for pre-mainnet test
Browse files Browse the repository at this point in the history
Signed-off-by: phutx <[email protected]>
  • Loading branch information
phutxorai committed Nov 7, 2022
1 parent 2b4100b commit e8dec49
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
],
"oraiswap-legacy": [
"oraiswap-legacy"
],
"oraiscan-pre-mainnet": [
"oraiscan-pre-mainnet"
]
}
}
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/pre-mainnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This is a basic workflow to help you get started with Actions

name: Pre-Mainnet

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [pre-mainnet]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
- name: Build Production
run: |
cp .env.example .env
yarn build
env:
REACT_APP_SENTRY_ENVIRONMENT: staging
CI: false
- name: Deploy to firebase
run: yarn firebase deploy --only hosting:oraiscan-pre-mainnet --token ${{ secrets.FIREBASE_TOKEN }} -m '${{ github.event.head_commit.message }}'
15 changes: 15 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@
"destination": "/index.html"
}
]
},
{
"target": "oraiscan-pre-mainnet",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
]
}

0 comments on commit e8dec49

Please sign in to comment.