From ff5a67aa14fed95b656bd17a21e11f69c5e0325d Mon Sep 17 00:00:00 2001 From: Bruno Perel Date: Thu, 22 Aug 2024 17:24:57 +0200 Subject: [PATCH] WIP calculate changed apps --- .github/workflows/deploy.yml | 10 +++++++++- apps/web/package.json | 1 - package.json | 12 ++++++------ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c590889b2..a13cd9c41 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,6 +14,7 @@ jobs: - name: Derive appropriate SHAs for base and head for `nx affected` commands uses: nrwl/nx-set-shas@v4 with: + workflow-id: deploy main-branch-name: "master" - run: | @@ -34,4 +35,11 @@ jobs: run: pnpm -r install - name: Check apps changed since the last successful commit - run: pnpm -r -F '[${{ env.NX_HEAD }}]' ls --depth -1 -j | jq -r '.[].path' | grep apps + run: | + changedApps=$(pnpm -r -F '[${{ env.NX_HEAD }}]' ls --depth -1 -j \ + \| jq -r '.[] \ + \| select(.path | contains("apps/")) | .name' \ + \| xargs -I {} echo -n "-F '{}' ") + echo "Changed apps: $changedApps" + pnpm build -r $changedApps + exit 1 diff --git a/apps/web/package.json b/apps/web/package.json index e9b8327f0..eb5f3070a 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -13,7 +13,6 @@ "story:dev": "histoire dev", "test": "vitest", "typecheck": "vue-tsc --noEmit", - "up": "taze major -I", "wait": "wait-on tcp:8001" }, "dependencies": { diff --git a/package.json b/package.json index 31cdaeaae..0c6e01431 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,12 @@ "prepare": "husky", "lint": "turbo lint --log-order=stream -F '!~duckguessr*' -- --cache --fix", "lint-no-cache": "turbo lint --log-order=stream -F '!~duckguessr*' -- --fix", - "build:web": "NODE_ENV=production turbo build --log-order=stream -F '~web...'", - "build:edgecreator": "NODE_ENV=production turbo build --log-order=stream -F '~edgecreator' -F '~edgecreator-api'", - "build:api": "NODE_ENV=production turbo build --log-order=stream -F '~api...'", - "build:coa-updater": "NODE_ENV=production turbo build --log-order=stream -F '~coa-updater...'", - "build:duck-estimator": "NODE_ENV=production turbo build --log-order=stream -F '~duck-estimator...'", - "build:stats-updater": "NODE_ENV=production turbo build --log-order=stream -F '~stats-updater...'", + "build:web": "NODE_ENV=production turbo build --log-order=stream --filter-prod '~web...'", + "build:edgecreator": "NODE_ENV=production turbo build --log-order=stream --filter-prod '~edgecreator' --filter-prod '~edgecreator-api'", + "build:api": "NODE_ENV=production turbo build --log-order=stream --filter-prod '~api...'", + "build:coa-updater": "NODE_ENV=production turbo build --log-order=stream --filter-prod '~coa-updater...'", + "build:duck-estimator": "NODE_ENV=production turbo build --log-order=stream --filter-prod '~duck-estimator...'", + "build:stats-updater": "NODE_ENV=production turbo build --log-order=stream --filter-prod '~stats-updater...'", "dev:edgecreator": "turbo dev -F '~edgecreator-api...' -F '~edgecreator' -F '~web' -F '~edges'", "dev:whattheduck": "turbo dev -F '~whattheduck' -F '~api' -F '~web'" }