Skip to content

Commit 5bd0c1f

Browse files
committed
feat: add environment variables for subgraph deployment configuration
1 parent 1268d1d commit 5bd0c1f

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.env.template

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,12 @@ IPFS_URL=...
99

1010
# The version label for the deployment (e.g., v1.0.0)
1111
VERSION_LABEL=...
12+
13+
# The slug for the subgraph created on The Graph Network
14+
SUBGRAPH_SLUG=...
15+
16+
# The deploy key for The Graph Network deployment
17+
SUBGRAPH_DEPLOY_KEY=...
18+
19+
# The network name for The Graph Network deployment (e.g., arbitrum-sepolia, arbitrum)
20+
SUBGRAPH_NETWORK_NAME=...

.github/workflows/deploy-subgraph-chainX.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,12 @@ jobs:
3535
cache: 'npm'
3636

3737
- name: Install dependencies
38-
working-directory: packages/subgraph
3938
run: npm ci
4039

4140
- name: Codegen
42-
working-directory: packages/subgraph
4341
run: npm run codegen
4442

4543
- name: Deploy Subgraph
46-
working-directory: packages/subgraph
4744
env:
4845
SUBGRAPH_DEPLOY_KEY: ${{ secrets.SUBGRAPH_DEPLOY_KEY }}
4946
SUBGRAPH_NETWORK_NAME: ${{ vars.SUBGRAPH_NETWORK_NAME }}

config/env.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ const envSchema = z.object({
1212
IPFS_URL: z.string().url('IPFS_URL must be a valid URL').default('http://localhost:5001'),
1313

1414
VERSION_LABEL: z.string().min(1, 'VERSION_LABEL is required').default('bellecour/poco-v5'),
15+
16+
SUBGRAPH_SLUG: z.string().min(1, 'SUBGRAPH_SLUG must not be empty').optional(),
17+
18+
SUBGRAPH_DEPLOY_KEY: z.string().min(1, 'SUBGRAPH_DEPLOY_KEY must not be empty').optional(),
19+
20+
SUBGRAPH_NETWORK_NAME: z.string().min(1, 'SUBGRAPH_NETWORK_NAME must not be empty').optional(),
1521
});
1622

1723
export const env = envSchema.parse(process.env);

0 commit comments

Comments
 (0)