63 lines (57 loc) · 1.71 KB
/
deploy-subgraph.yaml
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
name: Subgraph Deploy
on:
push:
branches: ['release/subgraph']
paths:
- 'subgraph/**'
- '.github/workflows/deploy-subgraph.yaml'
defaults:
run:
working-directory: ./subgraph/packages/subgraph-code
jobs:
build:
name: Build subgraph code
runs-on: 'ubuntu-latest'
strategy:
matrix:
network: ['polygon']
include:
- network: polygon
label: matic
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: |
yarn
- name: Obtain ABI from our latest HOPRnet npm package
run: |
yarn build-contract
- name: Generate the config for a particular network
env:
NETWORK: ${{ matrix.network }}
LABEL: ${{ matrix.label }}
STARTBLOCK: ${{ matrix.startBlock }}
run: |
NETWORK=${{ env.NETWORK }} yarn build-config
sed -i "s/${{ env.NETWORK }}/${{ env.LABEL }}/" config/${{ env.NETWORK }}.json
- name: Define the subgraph based on the previous config
env:
NETWORK: ${{ matrix.network }}
run: |
NETWORK=${{ env.NETWORK }} yarn define
- name: Generate assembly script types
run: |
yarn codegen
- name: Build wasm build for IPFS via graph-cli
run: |
yarn build
- name: Deploy subgraph to legacy explorer
env:
NETWORK: ${{ matrix.network }}
run: |
yarn deploy -- hoprnet/hopr-channels-${{ env.NETWORK }} --accessToken ${{ secrets.THEGRAPH_LEGACY_ACCESS_TOKEN }}