Skip to content

Commit e9f16d5

Browse files
committed
fix: subgraph workflow
1 parent 482a11c commit e9f16d5

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.github/workflows/deploy-subgraph.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
options:
1212
- arbitrum-goerli
1313
- arbitrum
14+
update:
15+
description: Whether to update the subgraph with the current artifacts for the selected network.
16+
required: true
17+
default: true
18+
type: boolean
1419

1520
permissions:
1621
contents: read
@@ -33,16 +38,38 @@ jobs:
3338
with:
3439
node-version: 16
3540

41+
- name: Install Yarn if running locally
42+
if: ${{ env.ACT }}
43+
run: npm install -g yarn
44+
3645
- name: Install the dependencies
3746
run: yarn install
3847

48+
- name: Install jq and yq
49+
if: ${{ inputs.update }}
50+
run: |
51+
mkdir bin
52+
wget -qO bin/jq https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64
53+
wget -qO bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
54+
chmod a+x bin/jq bin/yq
55+
56+
- name: Update the subgraph definition
57+
if: ${{ inputs.update }}
58+
run: |
59+
export PATH=$PWD/../bin:$PATH
60+
yarn update:${{ inputs.network }}
61+
working-directory: subgraph
62+
3963
- name: Build the subgraph
4064
run: |
4165
yarn codegen
4266
yarn build
43-
67+
working-directory: subgraph
68+
4469
- name: Authenticate with TheGraph
4570
run: yarn graph auth "${{ secrets.SUBGRAPH_AUTH_TOKEN }}" --product hosted-service
71+
working-directory: subgraph
4672

4773
- name: Deploy the subgraph
4874
run: yarn deploy:${{ inputs.network }}
75+
working-directory: subgraph

scripts/act-subgraph.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
act workflow_dispatch -j buildAndDeploy --input network=arbitrum-goerli,update=true

0 commit comments

Comments
 (0)