From 59aa4b7cc492c8681c2656f37b10f15aac5b8664 Mon Sep 17 00:00:00 2001 From: Filippo Fontana Date: Tue, 30 Apr 2024 00:09:54 +0200 Subject: [PATCH 1/3] ci: updated multichain deployment logic --- .github/workflows/deploy.yml | 41 +++++++++++------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 009885bf..654343cc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,47 +12,30 @@ permissions: issues: write jobs: - subql_deploy_staging: - if: ${{ github.repository == 'embrio-tech/centrifuge-subql'}} - name: Deploy to SubQL + subql_deploy_centrifuge_staging: + if: ${{ github.ref_name == 'main' }} + name: Deploy to SubQL (CENTRIFUGE staging) strategy: matrix: - chainId: [demo] + chainId: [development, demo] # ADD ARRAY OF CHAINS TO DEPLOY uses: ./.github/workflows/subql_deploy_workflow.yaml with: chainId: ${{ matrix.chainId }} projOrg: centrifuge projImage: 'https://centrifuge.io/static/bfb7682cb6ed4aa422d9d2c90cd9351a/centrifuge-logomark-black.svg' - deploymentType: stage - resetProject: false - secrets: - accessToken: ${{ secrets.SUBQL_ACCESS_TOKEN }} - onfinalityApiKey: ${{ secrets.ONFINALITY_API_KEY }} - - subql_deploy_staging_multichain: - if: ${{ github.repository == 'embrio-tech/centrifuge-subql'}} - name: Deploy to SubQL Multichain - strategy: - matrix: - chainId: [demo, centrifuge] - uses: ./.github/workflows/subql_multi_deploy_workflow.yaml - with: - chainId: ${{ matrix.chainId }} - projOrg: centrifuge - projImage: 'https://centrifuge.io/static/bfb7682cb6ed4aa422d9d2c90cd9351a/centrifuge-logomark-black.svg' - deploymentType: stage - resetProject: false + deploymentType: primary + resetProject: true secrets: accessToken: ${{ secrets.SUBQL_ACCESS_TOKEN }} onfinalityApiKey: ${{ secrets.ONFINALITY_API_KEY }} - subql_deploy_centrifuge_staging: - if: ${{ github.repository == 'centrifuge/pools-subql' && github.ref_name == 'main' }} + subql_deploy_multichain_staging: + if: ${{ github.ref_name == 'main' }} name: Deploy to SubQL (CENTRIFUGE staging) strategy: matrix: - chainId: [development, demo] # ADD ARRAY OF CHAINS TO DEPLOY - uses: ./.github/workflows/subql_deploy_workflow.yaml + chainId: [demo] # ADD ARRAY OF CHAINS TO DEPLOY + uses: ./.github/workflows/subql_multi_deploy_workflow.yaml with: chainId: ${{ matrix.chainId }} projOrg: centrifuge @@ -64,7 +47,7 @@ jobs: onfinalityApiKey: ${{ secrets.ONFINALITY_API_KEY }} subql_deploy_centrifuge_production: - if: ${{ github.repository == 'centrifuge/pools-subql' && startsWith(github.ref_name, 'release-') }} + if: ${{ startsWith(github.ref_name, 'release-') }} name: Deploy to SubQL (CENTRIFUGE mainnet) strategy: matrix: @@ -81,7 +64,7 @@ jobs: onfinalityApiKey: ${{ secrets.ONFINALITY_API_KEY }} subql_deploy_centrifuge_multichain_production: - if: ${{ github.repository == 'centrifuge/pools-subql' && startsWith(github.ref_name, 'release-') }} + if: ${{ startsWith(github.ref_name, 'release-') }} name: Deploy to SubQL multichain (CENTRIFUGE mainnet) strategy: matrix: From 99e50b88e164d25f998429ebb38bdc87089a3c34 Mon Sep 17 00:00:00 2001 From: Filippo Fontana Date: Tue, 30 Apr 2024 11:02:07 +0200 Subject: [PATCH 2/3] ci: introduce development branch --- .github/workflows/deploy.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 654343cc..c6106685 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,7 +4,8 @@ on: push: branches: - main - - release-* + - development + #- release-* workflow_dispatch: permissions: @@ -13,7 +14,7 @@ permissions: jobs: subql_deploy_centrifuge_staging: - if: ${{ github.ref_name == 'main' }} + if: ${{ github.ref_name == 'development' }} name: Deploy to SubQL (CENTRIFUGE staging) strategy: matrix: @@ -30,7 +31,7 @@ jobs: onfinalityApiKey: ${{ secrets.ONFINALITY_API_KEY }} subql_deploy_multichain_staging: - if: ${{ github.ref_name == 'main' }} + if: ${{ github.ref_name == 'development' }} name: Deploy to SubQL (CENTRIFUGE staging) strategy: matrix: @@ -47,7 +48,7 @@ jobs: onfinalityApiKey: ${{ secrets.ONFINALITY_API_KEY }} subql_deploy_centrifuge_production: - if: ${{ startsWith(github.ref_name, 'release-') }} + if: ${{ github.ref_name == 'main' }} name: Deploy to SubQL (CENTRIFUGE mainnet) strategy: matrix: @@ -64,7 +65,7 @@ jobs: onfinalityApiKey: ${{ secrets.ONFINALITY_API_KEY }} subql_deploy_centrifuge_multichain_production: - if: ${{ startsWith(github.ref_name, 'release-') }} + if: ${{ github.ref_name == 'main' }} name: Deploy to SubQL multichain (CENTRIFUGE mainnet) strategy: matrix: From 507c63fba7bc66f959be07fe07ae0f8056f69de7 Mon Sep 17 00:00:00 2001 From: Filippo Fontana Date: Tue, 30 Apr 2024 11:13:58 +0200 Subject: [PATCH 3/3] ci: improve stage naming --- .github/workflows/deploy.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c6106685..34d81078 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,9 +13,9 @@ permissions: issues: write jobs: - subql_deploy_centrifuge_staging: + subql_deploy_staging: if: ${{ github.ref_name == 'development' }} - name: Deploy to SubQL (CENTRIFUGE staging) + name: Deploy to SubQL (staging) strategy: matrix: chainId: [development, demo] # ADD ARRAY OF CHAINS TO DEPLOY @@ -32,7 +32,7 @@ jobs: subql_deploy_multichain_staging: if: ${{ github.ref_name == 'development' }} - name: Deploy to SubQL (CENTRIFUGE staging) + name: Deploy to SubQL multichain (staging) strategy: matrix: chainId: [demo] # ADD ARRAY OF CHAINS TO DEPLOY @@ -47,9 +47,9 @@ jobs: accessToken: ${{ secrets.SUBQL_ACCESS_TOKEN }} onfinalityApiKey: ${{ secrets.ONFINALITY_API_KEY }} - subql_deploy_centrifuge_production: + subql_deploy_production: if: ${{ github.ref_name == 'main' }} - name: Deploy to SubQL (CENTRIFUGE mainnet) + name: Deploy to SubQL (mainnet) strategy: matrix: chainId: [centrifuge] # ADD ARRAY OF CHAINS TO DEPLOY @@ -64,9 +64,9 @@ jobs: accessToken: ${{ secrets.SUBQL_ACCESS_TOKEN }} onfinalityApiKey: ${{ secrets.ONFINALITY_API_KEY }} - subql_deploy_centrifuge_multichain_production: + subql_deploy_multichain_production: if: ${{ github.ref_name == 'main' }} - name: Deploy to SubQL multichain (CENTRIFUGE mainnet) + name: Deploy to SubQL multichain (mainnet) strategy: matrix: chainId: [centrifuge] # ADD ARRAY OF CHAINS TO DEPLOY