Push subgraph #18
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
name: Push subgraph | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'dev/prod env' | |
default: 'development' | |
type: choice | |
required: true | |
options: | |
- development | |
- production | |
folder: | |
description: 'choose folder' | |
default: 'ens' | |
type: choice | |
required: true | |
options: | |
- blur | |
- ens | |
- erc-6551-accounts | |
- farcaster | |
- farcaster_v2 | |
- lens | |
- looksrare | |
- poap | |
- quickswap | |
- rarible-exchange-v1 | |
- rarible-exchange-v2 | |
- seaport-subgraph | |
- uniswap-v3 | |
subgraph_name: | |
description: 'subgraph name' | |
required: true | |
type: string | |
jobs: | |
build: | |
environment: development | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node.js 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Operations | |
run: | | |
git config --global url."https://${{ secrets.ACCESS_TOKEN_USR }}:${{ secrets.ACCESS_TOKEN_PWD }}@github.com/".insteadOf "[email protected]:" | |
git config --global url."https://${{ secrets.ACCESS_TOKEN_USR }}:${{ secrets.ACCESS_TOKEN_PWD }}@github.com/".insteadOf "https://github.com/" | |
- name: Run npm | |
working-directory: ${{ github.event.inputs.folder }} | |
run: | | |
echo $FOLDER_NAME | |
pwd | |
ls -lah | |
npm i | |
npm run codegen | |
npm run build | |
npm run deploy | |
- name: Run graph deploy on public IPFS node | |
run: | | |
if [ "${{ github.event.inputs.environment }}" == "development" ]; then | |
NODE_URL="$DEV_NODE_URL" | |
else | |
NODE_URL="$PROD_NODE_URL" | |
fi | |
graph deploy --node $NODE_URL --ipfs $IPFS_PUBLIC_NODE $SUBGRAPH_NAME | |
- name: Run graph deploy on public Infura node | |
run: | | |
if [ "${{ github.event.inputs.environment }}" == "development" ]; then | |
NODE_URL="$DEV_NODE_URL" | |
else | |
NODE_URL="$PROD_NODE_URL" | |
fi | |
graph deploy --node $NODE_URL --ipfs $IPFS_INFURA_NODE ---headers '{\"Authorization\": \"Basic $INFURA_HASH\"}' $SUBGRAPH_NAME | |
env: | |
ENVIRONMENT: ${{ github.event.inputs.environment }} | |
SUBGRAPH_NAME: ${{ github.event.inputs.subgraph_name }} | |
FOLDER_NAME: ${{ github.event.inputs.folder }} | |
DEV_NODE_URL: ${{ secrets.DEV_NODE_URL }} | |
PROD_NODE_URL: ${{ secrets.PROD_NODE_URL }} | |
INFURA_HASH: ${{ secrets.INFURA_AUTH_HEADERS }} | |
IPFS_PUBLIC_NODE: ${{ secrets.IPFS_PUBLIC_NODE }} | |
IPFS_INFURA_NODE: ${{ secrets.IPFS_INFURA_NODE }} | |