-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Marin Petrunić <[email protected]>
- Loading branch information
Showing
95 changed files
with
7,686 additions
and
4,560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,121 +1,32 @@ | ||
# naming convention: <project>/<environment>/<task> | ||
name: multix/stage/deploy | ||
name: subsquid aquarium deployment | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'packages/squid/**' | ||
- 'squid/**' | ||
- '.github/workflows/deploy-squid-stage.yaml' | ||
branches: | ||
- main | ||
# - ci/* # run this workflow if the branch starts with ci/* | ||
|
||
env: | ||
# secrets are listed here to simplify the readability | ||
AWS_REGION: '${{ secrets.AWS_REGION }}' | ||
AWS_ACCOUNT_ID: '${{ secrets.AWS_ACCOUNT_ID }}' | ||
AWS_ROLE_NAME: '${{ secrets.AWS_ROLE_NAME }}' | ||
APP_STAGE: 'stage' | ||
DOCKER_REGISTRY: 'ghcr.io' | ||
DOCKER_TAG: 'latest' | ||
ENV_FILE: '${{ secrets.ENV_FILE }}' | ||
- ci/* # run this workflow if the branch starts with "ci/"" | ||
|
||
jobs: | ||
push: | ||
name: push | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: ['squid-indexer', 'graphql-server'] | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
packages: write | ||
|
||
steps: | ||
- name: checkout the source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: setup docker buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: login to ghcr | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.DOCKER_REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: docker build image | ||
uses: docker/build-push-action@v4 | ||
env: | ||
BUILDX_NO_DEFAULT_ATTESTATIONS: 1 | ||
with: | ||
context: . | ||
push: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
provenance: false | ||
target: ${{ matrix.target }} | ||
platforms: | | ||
linux/amd64 | ||
tags: | | ||
${{ env.DOCKER_REGISTRY }}/chainsafe/multix-${{ matrix.target }}:${{ env.DOCKER_TAG }} | ||
${{ env.DOCKER_REGISTRY }}/chainsafe/multix-${{ matrix.target }}:${{ github.sha }} | ||
deploy: | ||
needs: push | ||
name: deploy | ||
runs-on: self-hosted | ||
strategy: | ||
matrix: | ||
network: ['kusama', 'polkadot', 'rococo', 'phala', 'khala'] | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: squid | ||
steps: | ||
- name: checkout the source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: setup nodejs with yarn cache | ||
uses: actions/setup-node@v3 | ||
continue-on-error: true | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.node-version' | ||
cache: 'yarn' | ||
|
||
- name: install dependencies in root and squid package | ||
run: | | ||
corepack enable | ||
yarn workspaces focus multix-squid | ||
- name: generate squid code | ||
run: yarn workspace multix-squid codegen | ||
|
||
- name: build the squid package | ||
run: yarn workspace multix-squid build | ||
|
||
- name: generate database credentials | ||
env: | ||
SECRET_NAME: '${{ env.APP_STAGE }}/multix/${{ matrix.network }}' | ||
run: generate-credentials "${{ env.SECRET_NAME }}" "${{ env.AWS_REGION }}" | ||
|
||
- name: stop current service | ||
env: | ||
AWS_CLUSTER_NAME: 'multix-${{ env.APP_STAGE }}' | ||
run: stop-service "${{ env.AWS_CLUSTER_NAME }}" "${{ matrix.network }}" "${{ env.AWS_REGION }}" | ||
|
||
- name: dump database | ||
run: drop-tables | ||
|
||
- name: run migration | ||
node-version: 16 | ||
cache: 'npm' | ||
- name: install @subsquid/cli | ||
run: npm install --location=global @subsquid/cli | ||
- name: auth subsquid | ||
run: | | ||
source "${{ env.ENV_FILE }}" | ||
yarn workspace multix-squid db:migrate | ||
- name: cleanup credentials | ||
if: always() | ||
run: cleanup-credentials | ||
sqd auth -k ${{ secrets.SUBSQUID_DEPLOYMENT_KEY }} | ||
- name: deploy subsquid | ||
id: deploy | ||
run: sqd deploy -u . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,7 @@ target | |
node_modules | ||
lib | ||
build | ||
builds | ||
.env | ||
*DS_Store | ||
*.tsbuildinfo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const config = { | ||
tabWidth: 2, | ||
semi: false, | ||
singleQuote: true, | ||
arrowParens: 'always', | ||
singleAttributePerLine: true, | ||
printWidth: 100, | ||
trailingComma: 'none' | ||
} | ||
|
||
module.exports = { ...config } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
packages/squid/src/processorHandlers/handleNewMultisigCalls.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.