From eb41e79238c9e15c4da6cfc2058bc78e735358e9 Mon Sep 17 00:00:00 2001 From: Alexandre ABRIOUX Date: Mon, 3 Jun 2024 17:43:47 +0200 Subject: [PATCH] ci: test and build only --- .github/workflows/ci.yaml | 30 ++++++++++++++++++++++++++++ .github/workflows/deploy.yaml | 37 ----------------------------------- README.md | 4 ---- package.json | 8 ++------ 4 files changed, 32 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..4e841e4 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,30 @@ +on: + push: + branches: + - main + pull_request: + branches: + - main + +concurrency: + group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" + cancel-in-progress: true + +jobs: + build-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: corepack enable + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + cache: "pnpm" + - run: corepack enable + - name: Install deps + run: pnpm i + - name: Build + run: pnpm build + - name: Test + run: pnpm test diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml deleted file mode 100644 index ccebab8..0000000 --- a/.github/workflows/deploy.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: "Deploy to Google Cloud Functions" - -on: - push: - branches: - - main - -jobs: - build-deploy: - runs-on: ubuntu-latest - permissions: - contents: "read" - id-token: "write" - steps: - - uses: actions/checkout@v4 - - run: corepack enable - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - cache: "pnpm" - - run: corepack enable - - name: Install deps - run: pnpm i - - uses: google-github-actions/auth@v2 - with: - workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} - service_account: ${{ secrets.GCP_SA }} - - uses: google-github-actions/setup-gcloud@v2 - with: - project_id: ${{ secrets.GCP_PROJECT_ID }} - - name: Build - run: pnpm build - - name: Test - run: pnpm test - - name: Deploy - run: pnpm deploy:function diff --git a/README.md b/README.md index a7eb0b2..44d1623 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,3 @@ Small utility to receive slack alerts when a given EVM wallet balance is low (un pnpm install SPREADSHEET_ID=[your spreadhsheet id] ETHERSCAN_API_KEY_[NETWORK]=[your Etherscan API key] node index.js ``` - -### Push new version - -Any commit to `main` will be automatically deployed. diff --git a/package.json b/package.json index 7f5c7e6..8161465 100644 --- a/package.json +++ b/package.json @@ -19,15 +19,11 @@ "typescript": "^5.4.3" }, "scripts": { - "build:cp-package-json": "cp package.json build/", - "build": "rimraf build && mkdir build && pnpm build:cp-package-json && tsc", - "gcp-build": "", + "build": "rimraf build && mkdir build && cp package.json build/ && tsc", "watch": "tsc --watch", "test": "jest", "prettier": "prettier --write .", - "start": "ts-node src/run.ts", - "deploy": "pnpm build && pnpm deploy:function", - "deploy:function": "gcloud functions deploy sync-wallet-balance --entry-point main --source build --runtime=nodejs20" + "start": "ts-node src/run.ts" }, "engines": { "node": "^20.0.0",