From 8f020306d93eec8150a2dd158403352b7212cf87 Mon Sep 17 00:00:00 2001 From: DC Date: Mon, 2 Dec 2024 01:56:07 -0800 Subject: [PATCH] clippy: fix cd --- .github/workflows/cd.yml | 11 ++++++++++- apps/daimo-clippy/Dockerfile | 10 ++-------- apps/daimo-clippy/package.json | 4 ++-- apps/daimo-mobile/src/view/screen/SettingsScreen.tsx | 2 +- apps/daimo-mobile/src/view/shared/error.tsx | 6 +++--- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8ddf1a43a..079077a36 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -11,7 +11,7 @@ on: jobs: api-deploy: # master and prod only, no tags - if: startsWith(github.ref, 'refs/heads/') + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/prod' name: API Deploy runs-on: ubuntu-latest steps: @@ -124,6 +124,15 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - uses: actions/setup-node@v3 + with: + node-version: "22.x" + + - name: Build JS bundle + run: | + npm ci + npx turbo build --filter='@daimo/clippy' + - name: Build, tag, and push docker image to Amazon ECR uses: docker/build-push-action@v5 with: diff --git a/apps/daimo-clippy/Dockerfile b/apps/daimo-clippy/Dockerfile index 579054769..0110b80d1 100644 --- a/apps/daimo-clippy/Dockerfile +++ b/apps/daimo-clippy/Dockerfile @@ -5,16 +5,10 @@ FROM node:20 WORKDIR /usr/src/app # Copy app code -COPY . . - -# Install dependencies -RUN npm ci - -# Build app -RUN npm run build:clippy +COPY apps/daimo-clippy/dist ./dist # Expose the port the app runs on EXPOSE 4200 # Start app -CMD ["npm", "start", "--prefix", "./apps/daimo-clippy"] +CMD ["node", "dist/index.js"] diff --git a/apps/daimo-clippy/package.json b/apps/daimo-clippy/package.json index 81e79566c..226d32cc1 100644 --- a/apps/daimo-clippy/package.json +++ b/apps/daimo-clippy/package.json @@ -3,8 +3,8 @@ "version": "1.0.0", "main": "src/index.ts", "scripts": { - "dev": "echo Use 'npm start' for Clippy dev", - "start": "tsx src/index.ts", + "dev": "tsx src/index.ts", + "build": "esbuild --bundle src/index.ts --platform=node --external:readline/promises --outdir=dist", "lint": "npm run lint:deps && npm run lint:style", "lint:deps": "npx depcheck --ignores @tsconfig/node20,@types/tape", "lint:style": "eslint . --max-warnings=0" diff --git a/apps/daimo-mobile/src/view/screen/SettingsScreen.tsx b/apps/daimo-mobile/src/view/screen/SettingsScreen.tsx index ee35cee24..af4df9470 100644 --- a/apps/daimo-mobile/src/view/screen/SettingsScreen.tsx +++ b/apps/daimo-mobile/src/view/screen/SettingsScreen.tsx @@ -210,7 +210,7 @@ function DevicesSection({ account }: { account: Account }) { chain={daimoChainFromId(account.homeChainId)} pendingRemoval={ account.pendingKeyRotation.find( - (k) => k.rotationType === "remove" && k.slot === keyData.slot, + (k) => k.rotationType === "remove" && k.slot === keyData.slot ) !== undefined } /> diff --git a/apps/daimo-mobile/src/view/shared/error.tsx b/apps/daimo-mobile/src/view/shared/error.tsx index 574d261ba..d524e4ee8 100644 --- a/apps/daimo-mobile/src/view/shared/error.tsx +++ b/apps/daimo-mobile/src/view/shared/error.tsx @@ -3,12 +3,12 @@ import Octicons from "@expo/vector-icons/Octicons"; import { useMemo } from "react"; import { Linking, Platform, StyleSheet, View } from "react-native"; -import { useExitToHome } from "../../common/nav"; -import { Colorway } from "../style/skins"; -import { useTheme } from "../style/theme"; import { ButtonBig } from "./Button"; import Spacer from "./Spacer"; import { DaimoText, TextCenter, TextError, TextH3 } from "./text"; +import { useExitToHome } from "../../common/nav"; +import { Colorway } from "../style/skins"; +import { useTheme } from "../style/theme"; export function ErrorRowCentered({ error,