Skip to content

Deploy Subgraph

Deploy Subgraph #1

name: Deploy Subgraph
on:
workflow_dispatch: # Triggered manually but we can also trigger with an release event
inputs:
environment:
description: 'Deployment environment (must match a GitHub Environment name)'
required: true
default: staging
type: choice
options:
- staging
- production
- tmp
versionLabel:
description: 'Version Label for Subgraph Deployment'
required: true
type: string
jobs:
build-and-test:
uses: ./.github/workflows/main.yml
with:
node-version: 20
deploy:
runs-on: ubuntu-latest
# Associate the job with a GitHub Environment which has pre-defined variables and secrets.
environment: ${{ github.event.inputs.environment }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Deploy Subgraph
env:
NETWORK_NAME: bellecour
VERSION_LABEL: ${{ github.event.inputs.versionLabel }}
GRAPHNODE_URL: ${{ vars.GRAPHNODE_URL }}
IPFS_URL: ${{ vars.IPFS_URL }}
DEPLOY_ENV: ${{ vars.ENV_NAME }}
run: |
echo "Starting deployment with the following parameters:"
echo " Network Name: $NETWORK_NAME"
echo " Version Label: $VERSION_LABEL"
echo " DEPLOY_ENV: $DEPLOY_ENV"
echo " GRAPHNODE_URL: $GRAPHNODE_URL"
echo " IPFS_URL: $IPFS_URL"
npm run all
shell: bash