Skip to content

Commit a756962

Browse files
committed
feat: Update GitHub workflows for subgraph deployment and testing
1 parent 7d9e178 commit a756962

File tree

4 files changed

+75
-19
lines changed

4 files changed

+75
-19
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Deploy Subgraph - on TheGraph Network
2+
3+
on:
4+
workflow_dispatch: # Manual trigger
5+
inputs:
6+
network:
7+
description: 'Network'
8+
required: true
9+
type: choice
10+
options:
11+
- arbitrumSepolia
12+
- arbitrum
13+
version_label:
14+
description: 'Version label for the subgraph deployment'
15+
required: true
16+
type: string
17+
18+
jobs:
19+
build-and-test:
20+
uses: ./.github/workflows/main.yml
21+
with:
22+
node-version: 20
23+
24+
deploy:
25+
needs: build-and-test
26+
runs-on: ubuntu-latest
27+
# Associate the job with a GitHub Environment which has pre-defined variables and secrets.
28+
environment: ${{ github.event.inputs.network }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: '20'
35+
cache: 'npm'
36+
37+
- name: Install dependencies
38+
working-directory: packages/subgraph
39+
run: npm ci
40+
41+
- name: Codegen
42+
working-directory: packages/subgraph
43+
run: npm run codegen
44+
45+
- name: Deploy Subgraph
46+
working-directory: packages/subgraph
47+
env:
48+
SUBGRAPH_DEPLOY_KEY: ${{ secrets.SUBGRAPH_DEPLOY_KEY }}
49+
SUBGRAPH_NETWORK_NAME: ${{ vars.SUBGRAPH_NETWORK_NAME }}
50+
SUBGRAPH_SLUG: ${{ vars.SUBGRAPH_SLUG }}
51+
VERSION_LABEL: ${{ github.event.inputs.version_label }}
52+
run: npm run deploy-chainX
53+
54+
- name: Deployment Success
55+
run: |
56+
echo "🎉 Subgraph deployment completed successfully!"
57+
echo "📋 Next steps:"
58+
echo "1. Go to TheGraph Studio: https://thegraph.com/studio/"
59+
echo "2. Connect with the iExec wallet"
60+
echo "3. Publish the subgraph to make it publicly available"
61+
echo "4. Subgraph details:"
62+
echo " - Slug: ${{ vars.SUBGRAPH_SLUG }}"
63+
echo " - Network: ${{ vars.SUBGRAPH_NETWORK_NAME }}"
64+
echo " - Version: ${{ github.event.inputs.version_label }}"

.github/workflows/deploy-subgraph.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,9 @@ on:
1212
- staging
1313
- production
1414
- tmp
15-
# Add new networks when needed. Do not forget to add necessary data in the networks.json file.
16-
networkName:
17-
description: 'Network Name'
18-
required: false
19-
default: bellecour
20-
type: choice
21-
options:
22-
- bellecour
2315
versionLabel:
2416
description: 'Version Label for Subgraph Deployment'
25-
required: false
26-
default: develop
17+
required: true
2718
type: string
2819

2920
jobs:
@@ -39,6 +30,7 @@ jobs:
3930
uses: actions/setup-node@v4
4031
with:
4132
node-version: '20'
33+
cache: 'npm'
4234

4335
- name: Install dependencies
4436
run: npm ci

.github/workflows/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: default
22

33
on:
4-
push:
5-
branches:
6-
- feature/*
7-
- bugfix/*
8-
- release/*
9-
- hotfix/*
10-
- develop
11-
- main
4+
pull_request:
5+
workflow_call:
6+
inputs:
7+
node-version:
8+
description: Node.js version to use
9+
required: false
10+
type: number
11+
default: 20
1212

1313
concurrency:
1414
group: ci-${{ github.head_ref }}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.18
1+
20

0 commit comments

Comments
 (0)