-
Notifications
You must be signed in to change notification settings - Fork 5
55 lines (55 loc) · 1.7 KB
/
deploy.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
name: Deploy Graph
on:
workflow_dispatch:
inputs:
environment:
type: environment
description: Select environment
subgraph:
type: choice
description: Select subgraph
options:
- bridgeworld
- bridgeworld-approvals
- bridgeworld-corruption
- bridgeworld-kote
- bridgeworld-recruits
- governance-staking
- magicswap
- smol
- memecoins
version:
description: Subgraph version
required: true
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./subgraphs/${{ inputs.subgraph }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci --prefix ../..
- name: Generate code for DEV
if: inputs.environment == 'Development'
run: npm run generate:dev --if-present
- name: Generate code for PROD
if: inputs.environment == 'Production'
run: npm run generate:prod --if-present
- name: Test
run: npm test --if-present
- name: Build subgraph
run: npx graph build
- name: Deploy to DEV
if: inputs.environment == 'Development'
run: npx goldsky subgraph deploy ${{ inputs.subgraph }}-dev/${{ inputs.version }} --token ${{ secrets.GOLDSKY_DEPLOY_KEY }}
- name: Deploy to PROD
if: inputs.environment == 'Production'
run: npx goldsky subgraph deploy ${{ inputs.subgraph }}/${{ inputs.version }} --token ${{ secrets.GOLDSKY_DEPLOY_KEY }}