-
Notifications
You must be signed in to change notification settings - Fork 46
75 lines (63 loc) · 2.12 KB
/
deploy-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
name: Deploy the Subgraph
on:
workflow_dispatch:
inputs:
network:
description: The network to deploy the subgraph to
required: true
default: 'arbitrum-goerli'
type: choice
options:
- arbitrum-goerli
- arbitrum
update:
description: Whether to update the subgraph with the current artifacts for the selected network.
required: true
default: true
type: boolean
permissions:
contents: read
jobs:
buildAndDeploy:
runs-on: ubuntu-latest
environment: kleros-org-subgraph
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.5.0
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Set up Node.js
uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2.5.2
with:
node-version: 16
- name: Install Yarn if running locally
if: ${{ env.ACT }}
run: npm install -g yarn
- name: Install the dependencies
run: yarn install
- name: Install jq and yq
if: ${{ inputs.update }}
run: |
mkdir bin
wget -qO bin/jq https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64
wget -qO bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
chmod a+x bin/jq bin/yq
- name: Update the subgraph definition
if: ${{ inputs.update }}
run: |
export PATH=$PWD/../bin:$PATH
yarn update:${{ inputs.network }}
working-directory: subgraph
- name: Build the subgraph
run: |
yarn codegen
yarn build
working-directory: subgraph
- name: Authenticate with TheGraph
run: yarn graph auth "${{ secrets.SUBGRAPH_AUTH_TOKEN }}" --product hosted-service
working-directory: subgraph
- name: Deploy the subgraph
run: yarn deploy:${{ inputs.network }}
working-directory: subgraph