-
Notifications
You must be signed in to change notification settings - Fork 4
99 lines (88 loc) · 2.77 KB
/
push-subgraph.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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
echo $SUBGRAPH_NAME
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
echo $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 }}