From 671e9ddfe14eeee8153a5cdd08e7461cc5275935 Mon Sep 17 00:00:00 2001 From: Ludovic Levalleux Date: Wed, 20 Nov 2024 18:09:29 +0000 Subject: [PATCH 1/4] ci: force the production subgraph deployment to be on a release tag --- .github/workflows/deploy-prod-subgraph.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-prod-subgraph.yaml b/.github/workflows/deploy-prod-subgraph.yaml index a1a782811..68d09e80b 100644 --- a/.github/workflows/deploy-prod-subgraph.yaml +++ b/.github/workflows/deploy-prod-subgraph.yaml @@ -2,7 +2,10 @@ name: Deploy subgraph to production env on: workflow_dispatch: - branches: [main] + inputs: + version: + description: "The subgraph version to deploy. For example, 1.34.0. The given number should correspond to an existing tag @bosonprotocol/subgraph@" + required: true jobs: deploy: @@ -12,6 +15,7 @@ jobs: - uses: actions/checkout@v3 with: token: ${{ secrets.BSNORG_ACTIONS_SECRET }} + ref: ref/tags/@bosonprotocol/subgraph@${{ inputs.version }} - uses: actions/setup-node@v3 with: node-version: "20" @@ -48,4 +52,4 @@ jobs: run: | git add . git commit -m "chore: deploy production subgraphs [skip ci]" - git push origin HEAD + git push origin HEAD:main From 742430080075a210e2cde00f0977318c604a6328 Mon Sep 17 00:00:00 2001 From: Ludovic Levalleux Date: Wed, 20 Nov 2024 18:17:38 +0000 Subject: [PATCH 2/4] try syntax change to fix git checkout --- .github/workflows/deploy-prod-subgraph.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-prod-subgraph.yaml b/.github/workflows/deploy-prod-subgraph.yaml index 68d09e80b..422b91abf 100644 --- a/.github/workflows/deploy-prod-subgraph.yaml +++ b/.github/workflows/deploy-prod-subgraph.yaml @@ -15,7 +15,8 @@ jobs: - uses: actions/checkout@v3 with: token: ${{ secrets.BSNORG_ACTIONS_SECRET }} - ref: ref/tags/@bosonprotocol/subgraph@${{ inputs.version }} + ref: @bosonprotocol/subgraph@${{ inputs.version }} + fetch-depth: "0" - uses: actions/setup-node@v3 with: node-version: "20" From 55ed7a38963d72d56bb091c5fa5cbe92edd448bf Mon Sep 17 00:00:00 2001 From: Ludovic Levalleux Date: Wed, 20 Nov 2024 18:19:57 +0000 Subject: [PATCH 3/4] fix syntax error ? --- .github/workflows/deploy-prod-subgraph.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-prod-subgraph.yaml b/.github/workflows/deploy-prod-subgraph.yaml index 422b91abf..6395b524e 100644 --- a/.github/workflows/deploy-prod-subgraph.yaml +++ b/.github/workflows/deploy-prod-subgraph.yaml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v3 with: token: ${{ secrets.BSNORG_ACTIONS_SECRET }} - ref: @bosonprotocol/subgraph@${{ inputs.version }} + ref: "@bosonprotocol/subgraph@${{ inputs.version }}" fetch-depth: "0" - uses: actions/setup-node@v3 with: From 1c3136e0bd0d558e48702577107b54bcc7fa4bfe Mon Sep 17 00:00:00 2001 From: Ludovic Levalleux Date: Wed, 20 Nov 2024 18:31:03 +0000 Subject: [PATCH 4/4] add git pull origin main before try pushing the log changes --- .github/workflows/deploy-prod-subgraph.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-prod-subgraph.yaml b/.github/workflows/deploy-prod-subgraph.yaml index 6395b524e..784a03b55 100644 --- a/.github/workflows/deploy-prod-subgraph.yaml +++ b/.github/workflows/deploy-prod-subgraph.yaml @@ -51,6 +51,7 @@ jobs: GH_TOKEN: ${{ secrets.BSNORG_ACTIONS_SECRET }} GITHUB_TOKEN: ${{ secrets.BSNORG_ACTIONS_SECRET }} run: | + git pull origin main git add . git commit -m "chore: deploy production subgraphs [skip ci]" git push origin HEAD:main