Skip to content

Latest commit

 

History

430 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autonolas Subgraph

Deploy to Production (GitHub Actions)

Production deployments are managed through GitHub Actions for consistency and security.

⚠️ Important: Production deployments are only allowed from the main branch. Staging deployments can be triggered from any branch.

Option 1: Using the GitHub UI

  1. Go to the Actions tab in the GitHub repository
  2. Click "Run workflow"
  3. Fill in the required parameters:
    • Environment: Choose production or staging
    • Subgraph: Name of the subgraph to deploy (e.g., autonolas, mech)
    • Version: Semantic version to deploy (e.g., v0.1.2)
    • Manifest: Manifest file name (e.g., subgraph.yaml or subgraph.base.yaml)
  4. Click "Run workflow"

Option 2: Using the deployment script

Run the interactive deployment script to generate the GitHub CLI command:

node scripts/deploy.ts

The script will:

  • Prompt you to select the subgraph
  • Prompt you to select the manifest file
  • Ask for the version to deploy
  • Generate the gh workflow run command for you to execute

What the workflow does

Once triggered (via UI or CLI), the workflow will:

  • Display a deployment plan with your inputs
  • Validate version format, subgraph folder, and manifest file
  • Build and deploy the subgraph to production
  • Display a summary with the deployment URL

Subgraph naming convention:

  • Format: {subgraph}-{network}-{version} or {subgraph}-{version} (if no network)
  • Version format: Dots (.) are replaced with underscores (_)
  • Examples:
    • autonolas-v0_1_2 (from subgraph.yaml)
    • tokenomics-mode-mainnet-v0_1_2 (from subgraph.mode-mainnet.yaml)

The deployed subgraph will be available at:

https://subgraph.autonolas.tech/subgraphs/name/{SUBGRAPH_NAME}

Example queries for testing

  1. Query all available records
{
    units{
        id,
        tokenId,
        packageType,
        metadataHash,
        packageHash,
        publicId
    }
}
  1. Query by package hash
{
    units(where:{packageHash:<package_hash>}){
        id,
        tokenId,
        packageType,
        metadataHash,
        packageHash,
        publicId
    }
}
  1. Query by public id and package type
{
    units(where:{publicId:<public_id>,packageType:<package_type>}){
        id,
        tokenId,
        packageType,
        metadataHash,
        packageHash,
        publicId
    }
}

About

GitHub Actions workflows for deploying Autonolas subgraphs to staging and production.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages