From e0f30b5a7e89bd71bcd03f6517dc55de6c6de689 Mon Sep 17 00:00:00 2001 From: Julien-devatom Date: Wed, 22 May 2024 18:02:03 +0200 Subject: [PATCH] feat(ci): add Satsuma & Studio --- .github/workflows/ci.yml | 26 --------------- .github/workflows/deploy.yml | 62 ++++++++++++++++++++++++++++++++++++ README.md | 5 --- package.json | 1 - 4 files changed, 62 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca7bce9..5fd127f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,32 +32,6 @@ jobs: - name: Build subgraph run: yarn build - deployment: - name: Deploy to TheGraph hosted service - environment: - name: Hosted Service - url: https://thegraph.com/hosted-service/subgraph/morpho-association/morpho-blue - needs: builds - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version-file: .nvmrc - cache: yarn - - - name: Install dependencies - run: yarn --frozen-lockfile - - - name: Generate types - run: yarn codegen - - - name: Deploy to the hosted service - run: yarn graph auth --product hosted-service ${{ secrets.HOSTED_SERVICE_KEY }} && yarn deploy:hs - release: name: Create new release runs-on: ubuntu-latest diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..becb561 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,62 @@ +# trigger with new tag +name: Deploy subgraphs + +on: + push: + tags: + - 'v*' + +jobs: + deploy-studio: + name: Deploy to TheGraph Studio + runs-on: ubuntu-latest + environment: + name: TheGraph Studio + url: https://thegraph.com/explorer/subgraphs/8Lz789DP5VKLXumTMTgygjU2xtuzx8AhbaacgN5PYCAs + steps: + - uses: actions/checkout@v3 + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version-file: .nvmrc + cache: yarn + + - name: Install dependencies + run: yarn --frozen-lockfile + + - name: Generate types + run: yarn codegen + + - name: Deploy to the studio + run: | + yarn graph auth --product subgraph-studio ${{ secrets.SUBGRAPH_STUDIO_KEY }} && \ + yarn deploy morpho-blue --version-label ${{ github.ref }} + deploy-satsuma: + name: Deploy to Satsuma + runs-on: ubuntu-latest + environment: + name: Satsuma + url: https://subgraphs.alchemy.com/subgraphs/5856 + steps: + - uses: actions/checkout@v3 + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version-file: .nvmrc + cache: yarn + + - name: Install dependencies + run: yarn --frozen-lockfile + + - name: Generate types + run: yarn codegen + + - name: Deploy to the studio + run: | + yarn deploy morpho-blue \ + --version-label ${{ github.ref }} \ + --node https://subgraphs.alchemy.com/api/subgraphs/deploy \ + --deploy-key ${{ secrets.SATSUMA_DEPLOY_KEY }} \ + --ipfs https://ipfs.satsuma.xy \ No newline at end of file diff --git a/README.md b/README.md index 3976d9b..87c4c23 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,3 @@ The list is updated each time the DAO is trusting a new market. However, the subgraph is listing all created markets and computes the price by mapping a token symbol with a Chainlink price feed to compute the USD or ETH price of an asset (if a price feed exists). - - - -TODO: -checkk si les addons sont biens initialisés diff --git a/package.json b/package.json index c39c6e3..feb220b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "scripts": { "codegen": "graph codegen", "build": "graph build", - "deploy:hs": "graph deploy --product hosted-service morpho-association/morpho-blue", "create-local": "graph create --node http://localhost:8020/ morpho-org/morpho-blue", "remove-local": "graph remove --node http://localhost:8020/ morpho-org/morpho-blue", "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 morpho-org/morpho-blue",