Skip to content

Push subgraph

Push subgraph #21

Workflow file for this run

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: Install Yarn
run: |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install -y yarn
- name: Install graph-cli
run: |
sudo yarn global add @graphprotocol/graph-cli
- 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 }}