Skip to content

Commit e96794a

Browse files
ci: deploy the subgraph networks from a matrix again
The per-network jobs were only spelled out one by one so that each network's promotion job could depend on its own deployment. The promotion is a schedule now, so nothing needs to name a single network's job any more and the three workflows go back to one matrixed job each. The network's pending-deployment variable rides along in the matrix rather than being derived, so the six names stay greppable against the ones the 'Promote deployed subgraphs' schedule reads. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 3fafa0c commit e96794a

3 files changed

Lines changed: 60 additions & 99 deletions

File tree

.github/workflows/deploy-prod-subgraph.yaml

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,30 @@ on:
1010
permissions:
1111
contents: read
1212

13-
# Every network is deployed by its own job, so that a network which fails to deploy does
14-
# not hold back the others. Indexing the new version takes far longer than a job may run,
15-
# so no job waits for it: each deployment is flagged in a repository variable, and the
16-
# 'Promote deployed subgraphs' schedule moves the 'latest' tag once the version is indexed.
13+
# Every network is deployed on its own runner, so that a network which fails to deploy
14+
# does not hold back the others. Indexing the new version takes far longer than a job may
15+
# run, so no job waits for it: each deployment is flagged in a repository variable, and
16+
# the 'Promote deployed subgraphs' schedule moves the 'latest' tag once it is indexed.
1717
jobs:
18-
deploy-ethereum:
19-
name: Deploy Ethereum subgraph
18+
deploy:
19+
name: Deploy ${{ matrix.label }} subgraph
2020
runs-on: ubuntu-latest
2121
timeout-minutes: 45
22+
strategy:
23+
# A network that fails to deploy must not cancel the others
24+
fail-fast: false
25+
matrix:
26+
include:
27+
- network: ethereum
28+
label: Ethereum
29+
variable: SUBGRAPH_PENDING_PRODUCTION_ETHEREUM
30+
- network: base
31+
label: Base
32+
variable: SUBGRAPH_PENDING_PRODUCTION_BASE
2233
# Do not let two runs deploy the same subgraph at the same time, and never cancel one
2334
# mid-deployment
2435
concurrency:
25-
group: subgraph-deploy-production-ethereum
36+
group: subgraph-deploy-production-${{ matrix.network }}
2637
cancel-in-progress: false
2738
steps:
2839
- uses: actions/checkout@v3
@@ -36,36 +47,11 @@ jobs:
3647
# currently served: moving it is the promotion schedule's business.
3748
- id: deploy
3849
name: Deploy subgraph
39-
run: cd ./packages/subgraph && npm run deploy:production:ethereum
50+
run: cd ./packages/subgraph && npm run deploy:production:${{ matrix.network }}
4051
env:
4152
GOLDSKY_API_KEY: ${{ secrets.GOLDSKY_API_KEY_PRODUCTION }}
4253
GOLDSKY_FATAL_ERROR_WATCH_MINUTES: "5"
4354
- name: Flag the deployment for promotion
4455
env:
4556
GH_TOKEN: ${{ secrets.BSNORG_ACTIONS_SECRET }}
46-
run: gh variable set SUBGRAPH_PENDING_PRODUCTION_ETHEREUM --repo "$GITHUB_REPOSITORY" --body "${{ steps.deploy.outputs.version }}"
47-
48-
deploy-base:
49-
name: Deploy Base subgraph
50-
runs-on: ubuntu-latest
51-
timeout-minutes: 45
52-
concurrency:
53-
group: subgraph-deploy-production-base
54-
cancel-in-progress: false
55-
steps:
56-
- uses: actions/checkout@v3
57-
with:
58-
token: ${{ secrets.BSNORG_ACTIONS_SECRET }}
59-
ref: "@bosonprotocol/subgraph@${{ inputs.version }}"
60-
fetch-depth: "0"
61-
- uses: ./.github/actions/setup-subgraph
62-
- id: deploy
63-
name: Deploy subgraph
64-
run: cd ./packages/subgraph && npm run deploy:production:base
65-
env:
66-
GOLDSKY_API_KEY: ${{ secrets.GOLDSKY_API_KEY_PRODUCTION }}
67-
GOLDSKY_FATAL_ERROR_WATCH_MINUTES: "5"
68-
- name: Flag the deployment for promotion
69-
env:
70-
GH_TOKEN: ${{ secrets.BSNORG_ACTIONS_SECRET }}
71-
run: gh variable set SUBGRAPH_PENDING_PRODUCTION_BASE --repo "$GITHUB_REPOSITORY" --body "${{ steps.deploy.outputs.version }}"
57+
run: gh variable set ${{ matrix.variable }} --repo "$GITHUB_REPOSITORY" --body "${{ steps.deploy.outputs.version }}"

.github/workflows/deploy-staging-subgraph.yaml

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,31 @@ on:
88
permissions:
99
contents: read
1010

11-
# Every network is deployed by its own job, so that a network which fails to deploy does
12-
# not hold back the others. Indexing the new version takes far longer than a job may run,
13-
# so no job waits for it: each deployment is flagged in a repository variable, and the
14-
# 'Promote deployed subgraphs' schedule moves the 'latest' tag once the version is indexed.
11+
# Every network is deployed on its own runner, so that a network which fails to deploy
12+
# does not hold back the others. Indexing the new version takes far longer than a job may
13+
# run, so no job waits for it: each deployment is flagged in a repository variable, and
14+
# the 'Promote deployed subgraphs' schedule moves the 'latest' tag once it is indexed.
1515
jobs:
16-
deploy-sepolia:
16+
deploy:
1717
if: github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, '@bosonprotocol/subgraph@')
18-
name: Deploy Sepolia subgraph
18+
name: Deploy ${{ matrix.label }} subgraph
1919
runs-on: ubuntu-latest
2020
timeout-minutes: 45
21+
strategy:
22+
# A network that fails to deploy must not cancel the others
23+
fail-fast: false
24+
matrix:
25+
include:
26+
- network: sepolia
27+
label: Sepolia
28+
variable: SUBGRAPH_PENDING_STAGING_SEPOLIA
29+
- network: base
30+
label: Base Sepolia
31+
variable: SUBGRAPH_PENDING_STAGING_BASE
2132
# Do not let two runs deploy the same subgraph at the same time, and never cancel one
2233
# mid-deployment
2334
concurrency:
24-
group: subgraph-deploy-staging-sepolia
35+
group: subgraph-deploy-staging-${{ matrix.network }}
2536
cancel-in-progress: false
2637
steps:
2738
- uses: actions/checkout@v3
@@ -33,35 +44,11 @@ jobs:
3344
# currently served: moving it is the promotion schedule's business.
3445
- id: deploy
3546
name: Deploy subgraph
36-
run: cd ./packages/subgraph && npm run deploy:staging:sepolia
47+
run: cd ./packages/subgraph && npm run deploy:staging:${{ matrix.network }}
3748
env:
3849
GOLDSKY_API_KEY: ${{ secrets.GOLDSKY_API_KEY_STAGING }}
3950
GOLDSKY_FATAL_ERROR_WATCH_MINUTES: "5"
4051
- name: Flag the deployment for promotion
4152
env:
4253
GH_TOKEN: ${{ secrets.BSNORG_ACTIONS_SECRET }}
43-
run: gh variable set SUBGRAPH_PENDING_STAGING_SEPOLIA --repo "$GITHUB_REPOSITORY" --body "${{ steps.deploy.outputs.version }}"
44-
45-
deploy-base:
46-
if: github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, '@bosonprotocol/subgraph@')
47-
name: Deploy Base Sepolia subgraph
48-
runs-on: ubuntu-latest
49-
timeout-minutes: 45
50-
concurrency:
51-
group: subgraph-deploy-staging-base
52-
cancel-in-progress: false
53-
steps:
54-
- uses: actions/checkout@v3
55-
with:
56-
token: ${{ secrets.BSNORG_ACTIONS_SECRET }}
57-
- uses: ./.github/actions/setup-subgraph
58-
- id: deploy
59-
name: Deploy subgraph
60-
run: cd ./packages/subgraph && npm run deploy:staging:base
61-
env:
62-
GOLDSKY_API_KEY: ${{ secrets.GOLDSKY_API_KEY_STAGING }}
63-
GOLDSKY_FATAL_ERROR_WATCH_MINUTES: "5"
64-
- name: Flag the deployment for promotion
65-
env:
66-
GH_TOKEN: ${{ secrets.BSNORG_ACTIONS_SECRET }}
67-
run: gh variable set SUBGRAPH_PENDING_STAGING_BASE --repo "$GITHUB_REPOSITORY" --body "${{ steps.deploy.outputs.version }}"
54+
run: gh variable set ${{ matrix.variable }} --repo "$GITHUB_REPOSITORY" --body "${{ steps.deploy.outputs.version }}"

.github/workflows/deploy-testing-subgraph.yaml

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,30 @@ on:
1616
permissions:
1717
contents: read
1818

19-
# Every network is deployed by its own job, so that a network which fails to deploy does
20-
# not hold back the others. Indexing the new version takes far longer than a job may run,
21-
# so no job waits for it: each deployment is flagged in a repository variable, and the
22-
# 'Promote deployed subgraphs' schedule moves the 'latest' tag once the version is indexed.
19+
# Every network is deployed on its own runner, so that a network which fails to deploy
20+
# does not hold back the others. Indexing the new version takes far longer than a job may
21+
# run, so no job waits for it: each deployment is flagged in a repository variable, and
22+
# the 'Promote deployed subgraphs' schedule moves the 'latest' tag once it is indexed.
2323
jobs:
24-
deploy-sepolia:
25-
name: Deploy Sepolia subgraph
24+
deploy:
25+
name: Deploy ${{ matrix.label }} subgraph
2626
runs-on: ubuntu-latest
2727
timeout-minutes: 45
28+
strategy:
29+
# A network that fails to deploy must not cancel the others
30+
fail-fast: false
31+
matrix:
32+
include:
33+
- network: sepolia
34+
label: Sepolia
35+
variable: SUBGRAPH_PENDING_TESTING_SEPOLIA
36+
- network: base
37+
label: Base Sepolia
38+
variable: SUBGRAPH_PENDING_TESTING_BASE
2839
# Do not let two runs deploy the same subgraph at the same time, and never cancel one
2940
# mid-deployment
3041
concurrency:
31-
group: subgraph-deploy-testing-sepolia
42+
group: subgraph-deploy-testing-${{ matrix.network }}
3243
cancel-in-progress: false
3344
steps:
3445
- uses: actions/checkout@v3
@@ -40,34 +51,11 @@ jobs:
4051
# currently served: moving it is the promotion schedule's business.
4152
- id: deploy
4253
name: Deploy subgraph
43-
run: cd ./packages/subgraph && npm run deploy:testing:sepolia
54+
run: cd ./packages/subgraph && npm run deploy:testing:${{ matrix.network }}
4455
env:
4556
GOLDSKY_API_KEY: ${{ secrets.GOLDSKY_API_KEY_TESTING }}
4657
GOLDSKY_FATAL_ERROR_WATCH_MINUTES: "5"
4758
- name: Flag the deployment for promotion
4859
env:
4960
GH_TOKEN: ${{ secrets.GH_TOKEN }}
50-
run: gh variable set SUBGRAPH_PENDING_TESTING_SEPOLIA --repo "$GITHUB_REPOSITORY" --body "${{ steps.deploy.outputs.version }}"
51-
52-
deploy-base:
53-
name: Deploy Base Sepolia subgraph
54-
runs-on: ubuntu-latest
55-
timeout-minutes: 45
56-
concurrency:
57-
group: subgraph-deploy-testing-base
58-
cancel-in-progress: false
59-
steps:
60-
- uses: actions/checkout@v3
61-
with:
62-
token: ${{ secrets.GH_TOKEN }}
63-
- uses: ./.github/actions/setup-subgraph
64-
- id: deploy
65-
name: Deploy subgraph
66-
run: cd ./packages/subgraph && npm run deploy:testing:base
67-
env:
68-
GOLDSKY_API_KEY: ${{ secrets.GOLDSKY_API_KEY_TESTING }}
69-
GOLDSKY_FATAL_ERROR_WATCH_MINUTES: "5"
70-
- name: Flag the deployment for promotion
71-
env:
72-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
73-
run: gh variable set SUBGRAPH_PENDING_TESTING_BASE --repo "$GITHUB_REPOSITORY" --body "${{ steps.deploy.outputs.version }}"
61+
run: gh variable set ${{ matrix.variable }} --repo "$GITHUB_REPOSITORY" --body "${{ steps.deploy.outputs.version }}"

0 commit comments

Comments
 (0)