From 179bc1acc73428d5dd1041540204a9b94a6d00b4 Mon Sep 17 00:00:00 2001 From: Danilo Tuler Date: Thu, 14 Sep 2023 15:37:53 -0300 Subject: [PATCH] Continuous deployment (#3) Co-authored-by: Bruno Menezes --- .github/workflows/deploy.yaml | 40 +++++++++++++++++++++++++++++++++++ package.json | 4 ++-- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..fb6662a --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,40 @@ +name: Deploy +on: + push: + branches: + - main + - mainnet + - sepolia +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Aquarium Login + run: npm run sqd:auth + env: + SQD_API_KEY: ${{ secrets.SQD_API_KEY }} + + - name: Deploy sepolia + if: github.ref == 'refs/heads/sepolia' + run: npm run sqd:deploy:sepolia -- --no-stream-logs --update + + - name: Deploy mainnet + if: github.ref == 'refs/heads/mainnet' + run: npm run sqd:deploy:mainnet -- --no-stream-logs --update diff --git a/package.json b/package.json index a3fb046..daf6b5e 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "sqd:graphql": "sqd serve", "sqd:auth": "sqd auth -k $SQD_API_KEY", "sqd:deploy": "sqd deploy -o cartesi -m", - "sqd:deploy:mainnet": "run-s \"sqd:deploy -- {1} .\" -- \"squid-mainnet.yaml\"", - "sqd:deploy:sepolia": "run-s \"sqd:deploy -- {1} .\" -- \"squid-sepolia.yaml\"", + "sqd:deploy:mainnet": "run-s \"sqd:deploy -- {@} .\" -- \"squid-mainnet.yaml\"", + "sqd:deploy:sepolia": "run-s \"sqd:deploy -- {@} .\" -- \"squid-sepolia.yaml\"", "tsc": "tsc" }, "dependencies": {