The Graph - Manual Deployment to Dev #16
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: The Graph - Manual Deployment to Dev | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| network: | |
| description: "Network for Subgraph deployment - Ethereum Mainnet (Mainnet) or Gnosis Chain (Gnosis)" | |
| required: true | |
| options: | |
| - mainnet | |
| - gnosis | |
| type: choice | |
| type: | |
| description: "Brige type: Home or Foreign" | |
| required: true | |
| options: | |
| - home | |
| - foreign | |
| type: choice | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| name: Deployment | |
| runs-on: ubuntu-latest | |
| outputs: | |
| random_id: ${{ steps.random_id.outputs.random_id }} | |
| env: | |
| ACCESS_TOKEN: ${{ secrets.THEGRAPH_DEPLOY_API_KEY }} | |
| TYPE: ${{ inputs.type }} | |
| NETWORK: ${{ inputs.network }} | |
| DEBUG: true | |
| SUBGRAPH_NAME: gbc-bridge-${{ inputs.type }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: '**/node_modules' | |
| key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
| - name: Check for excluded branches | |
| if: startsWith(github.ref, 'refs/heads/main') | |
| run: | | |
| echo "This branch is excluded from workflow dispatch." | |
| exit 1 | |
| - name: Generate Random ID | |
| id: random_id | |
| run: | | |
| echo "random_id=$(openssl rand -hex 4)" >> $GITHUB_OUTPUT | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Install dependencies & build subgraphs | |
| run: | | |
| cd subgraph | |
| yarn install | |
| yarn codegen | |
| yarn build | |
| - name: Deploy Subgraphs | |
| env: | |
| SUBGRAPH_LABELS: "${{ github.ref_name }}-${{ steps.random_id.outputs.random_id }}" | |
| run: | | |
| cd subgraph | |
| yarn deploy | |
| notify: | |
| uses: ./.github/workflows/slack_release_notification.yml | |
| if: ${{ always() }} | |
| needs: deploy | |
| secrets: | |
| RELEASES_SLACK_WEBHOOK_URL: ${{ secrets.RELEASES_SLACK_WEBHOOK_URL }} | |
| with: | |
| environment: Development | |
| service: Bridge Monitor SubGraph | |
| success: ${{ contains(join(needs.*.result, ','), 'success') }} | |
| message: "deploy service `Bridge Monitor SubGraph` version `${{ github.ref_name }}-${{ needs.deploy.outputs.random_id }}`. Triggered by `${{ github.actor }}`." | |