Skip to content

Deploy Graph

Deploy Graph #784

Workflow file for this run

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 }}