-
Notifications
You must be signed in to change notification settings - Fork 10
ci: add deploy workflow for TheGraph Network #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
103fbef
feat: add deploy workflow for TheGraph Network
Le-Caignec 187b6a7
feat: add build-and-test job to subgraph deployment workflows
Le-Caignec 2f66ee3
fix: update node-version input to be optional with default value
Le-Caignec abbc35d
feat: enhance subgraph deployment workflow with version label and slu…
Le-Caignec 7288fe2
fix: remove push trigger from deploy workflow and add arbitrum-one ne…
Le-Caignec be77f70
fix: correct version label input key in deploy workflow
Le-Caignec e689dc3
fix: adjust working-directory for build step in subgraph CI workflow
Le-Caignec e960c35
feat: add deploy key and network name to subgraph deployment configur…
Le-Caignec e308f0f
fix: correct input key for version label in deploy workflow
Le-Caignec c3ea6fa
feat: add code generation step to subgraph deployment workflows
Le-Caignec b33d638
feat: add deployment success message and next steps to subgraph workflow
Le-Caignec b4e0e0f
fix: remove unnecessary whitespace in deploy subgraph workflow
Le-Caignec b3787f4
fix: reorder deploy-chainX script in package.json for consistency
Le-Caignec d4aee0d
fix: update build script to ensure code generation runs before building
Le-Caignec 615a3e7
fix: remove hardcoded addresses and start blocks from data sources in…
Le-Caignec 9230937
Update .github/workflows/deploy-subgraph-chainX.yml
Le-Caignec 30c0f17
Merge branch 'main' into fix/subgraph-ci-deployment
Le-Caignec c69b56c
Merge branch 'main' into fix/subgraph-ci-deployment
zguesmi 503ab67
feat: Add deploy workflow for Subgraph on TheGraph Network
Le-Caignec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| 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/subgraph-ci.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 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
Le-Caignec marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| cache: 'npm' | ||
| cache-dependency-path: 'packages/subgraph' | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: packages/subgraph | ||
| run: npm ci | ||
|
|
||
| - name: Codegen | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. duplicate from subrsubgraph-ci.yml
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that’s true — but we need it to make the deploy command work. |
||
| working-directory: packages/subgraph | ||
| run: npm run codegen | ||
|
|
||
| - name: Deploy Subgraph | ||
| working-directory: packages/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-chainX | ||
|
|
||
| - 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 }}" | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: Core Smart Contract - Default | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - '*' | ||
| paths: | ||
| - 'packages/subgraph/**' | ||
| workflow_call: | ||
| inputs: | ||
| node-version: | ||
| description: Node.js version to use | ||
| required: false | ||
| type: number | ||
| default: 20 | ||
|
|
||
| concurrency: | ||
| group: ${{ github.ref }}-subgraph-ci | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build-and-test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ inputs.node-version }} | ||
| cache: 'npm' | ||
| cache-dependency-path: 'packages/subgraph' | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: packages/subgraph | ||
| run: npm ci | ||
|
|
||
| - name: Check Format | ||
| working-directory: packages/subgraph | ||
| run: npm run check-format | ||
|
|
||
| - name: Codegen | ||
| working-directory: packages/subgraph | ||
| run: npm run codegen | ||
|
|
||
| # TODO: fix test command | ||
| # - name: Run unit tests | ||
| # working-directory: packages/subgraph | ||
| # run: npm run test | ||
|
|
||
| - name: Build | ||
| working-directory: packages/subgraph | ||
| run: npm run build |
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
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not a big fan of this ci file name. If you have a better suggestion, let me know!