Skip to content

Deploy Graph

Deploy Graph #800

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
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 DEV (Topaz)
if: inputs.environment == 'Development (Topaz)'
run: npm run generate:dev-topaz --if-present
- name: Generate code for DEV (Sepolia)
if: inputs.environment == 'Development (Sepolia)'
run: npm run generate:dev-sepolia --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 DEV (Topaz)
if: inputs.environment == 'Development (Topaz)'
run: npx goldsky subgraph deploy ${{ inputs.subgraph }}-dev-topaz/${{ inputs.version }} --token ${{ secrets.GOLDSKY_DEPLOY_KEY }}
- name: Deploy to DEV (Sepolia)
if: inputs.environment == 'Development (Sepolia)'
run: npx goldsky subgraph deploy ${{ inputs.subgraph }}-dev-sepolia/${{ 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 }}