Deploy Subgraph - on TheGraph Network #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Subgraph - on TheGraph Network | |
| on: | |
| workflow_dispatch: # Manual trigger | |
| inputs: | |
| network: | |
| description: 'Network' | |
| required: true | |
| type: choice | |
| options: | |
| - arbitrumSepolia | |
| - arbitrum | |
| version_label: | |
| description: 'Version label for the subgraph deployment' | |
| required: true | |
| type: string | |
| jobs: | |
| build-and-test: | |
| uses: ./.github/workflows/main.yml | |
| with: | |
| node-version: 20 | |
| deploy: | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| # Associate the job with a GitHub Environment which has pre-defined variables and secrets. | |
| environment: ${{ github.event.inputs.network }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Codegen | |
| run: npm run codegen | |
| - name: Deploy Subgraph | |
| env: | |
| SUBGRAPH_DEPLOY_KEY: ${{ secrets.SUBGRAPH_DEPLOY_KEY }} | |
| SUBGRAPH_NETWORK_NAME: ${{ vars.SUBGRAPH_NETWORK_NAME }} | |
| SUBGRAPH_SLUG: ${{ vars.SUBGRAPH_SLUG }} | |
| VERSION_LABEL: ${{ github.event.inputs.version_label }} | |
| run: npm run deploy-studio | |
| - name: Deployment Success | |
| run: | | |
| echo "🎉 Subgraph deployment completed successfully!" | |
| echo "📋 Next steps:" | |
| echo "1. Go to TheGraph Studio: https://thegraph.com/studio/" | |
| echo "2. Connect with the iExec wallet" | |
| echo "3. Publish the subgraph to make it publicly available" | |
| echo "4. Subgraph details:" | |
| echo " - Slug: ${{ vars.SUBGRAPH_SLUG }}" | |
| echo " - Network: ${{ vars.SUBGRAPH_NETWORK_NAME }}" | |
| echo " - Version: ${{ github.event.inputs.version_label }}" |