From 5142c0e881bde644f33841fb1698d4462058935c Mon Sep 17 00:00:00 2001 From: Dzmitry Lahunouski Date: Sat, 10 Aug 2024 19:32:57 +0100 Subject: [PATCH] ci --- .github/workflows/quality-gate.yml | 22 ++++++++++++---------- .github/workflows/release.example.yml | 13 +++++-------- conf/.example.env | 2 +- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/quality-gate.yml b/.github/workflows/quality-gate.yml index 032b5aa..83f9234 100644 --- a/.github/workflows/quality-gate.yml +++ b/.github/workflows/quality-gate.yml @@ -14,26 +14,28 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - - run: npm run typecheck; - - run: npm run lint - test: + - run: make lint + typecheck: needs: lint runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup + - name: Run typecheck + run: make typecheck + test: + needs: typecheck + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - name: Run unit tests - run: npm run test + run: make test build: - env: - NODE_PK: "0x0000000000000000000000000000000000000000000000000000000000000000" - RPC: "https://rpc.com" - WS_RPC: "wss://ethereum.publicnode.com" - NETWORK: "mainnet" needs: test runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Build - run: docker compose build; + run: make buildprod; diff --git a/.github/workflows/release.example.yml b/.github/workflows/release.example.yml index d19b462..e634698 100644 --- a/.github/workflows/release.example.yml +++ b/.github/workflows/release.example.yml @@ -13,15 +13,12 @@ permissions: jobs: build: - env: - NODE_PK: ${{ secrets.NODE_PK }} - RPC: ${{ secrets.RPC }} runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Build - run: docker compose build; + run: make buildprod; deploy: runs-on: ubuntu-latest steps: @@ -43,9 +40,9 @@ jobs: username: ${{ secrets.REMOTE_USER }} key: ${{ secrets.SERVER_SSH_KEY }} script: cd /root/automation-node; - export NODE_PK=${{ secrets.NODE_PK }} RPC=${{ secrets.RPC }} WS_RPC=${{ secrets.WS_RPC}} NETWORK=${{ env.NETWORK }}; - docker compose down; + printf 'NETWORK=%s \nNODE_ENV=production \n' "${{ env.NETWORK }}" >conf/.env + printf 'DOTENV_PRIVATE_KEY_SECRETS_ENV=%s\n' "${{ secrets.DOTENV_PRIVATE_KEY_SECRETS_ENV }}" >conf/.env.keys + make clearprod; docker builder prune -a -f; docker image prune -a -f; - docker compose create; - docker compose up -d + make upprod; diff --git a/conf/.example.env b/conf/.example.env index ff80491..3ec349c 100644 --- a/conf/.example.env +++ b/conf/.example.env @@ -1,4 +1,4 @@ # https://viem.sh/docs/chains/introduction NETWORK="mainnet" -NODE_ENV=development \ No newline at end of file +NODE_ENV=production \ No newline at end of file