From f02bd13e06dc109ddd4ac55c98bedc698199d275 Mon Sep 17 00:00:00 2001 From: Andres J Date: Sat, 7 Feb 2026 17:50:55 -0600 Subject: [PATCH] ci(docs): build only docs; avoid global dependsOn and fix affected filtering --- .github/workflows/docs.yml | 9 +++++++-- apps/docs/project.json | 29 ++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bd85c4d5..d2e11140 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -53,8 +53,13 @@ jobs: echo "No valid BASE commit found, building unconditionally" pnpm nx build "@effectify/docs" else - echo "Running nx affected build for `@effectify/docs` between ${BASE}..${HEAD}" - pnpm nx affected -t build --base="${BASE}" --head="${HEAD}" --projects="@effectify/docs" + echo "Checking if `@effectify/docs` is affected between ${BASE}..${HEAD}" + if pnpm nx show projects --affected --base="${BASE}" --head="${HEAD}" | grep -q "@effectify/docs"; then + echo "@effectify/docs is affected. Building only docs..." + pnpm nx build "@effectify/docs" + else + echo "@effectify/docs not affected. Skipping build." + fi fi if [ -d apps/docs/dist ]; then echo "should_deploy=true" >> "$GITHUB_OUTPUT" diff --git a/apps/docs/project.json b/apps/docs/project.json index 91a75a08..2e35fb4f 100644 --- a/apps/docs/project.json +++ b/apps/docs/project.json @@ -3,5 +3,32 @@ "name": "@effectify/docs", "projectType": "application", "sourceRoot": "apps/docs/src", - "tags": ["docs"] + "tags": ["docs"], + "targets": { + "build": { + "executor": "nx:run-script", + "cache": true, + "inputs": ["production"], + "dependsOn": [], + "options": { + "script": "build" + } + }, + "dev": { + "executor": "nx:run-script", + "cache": false, + "dependsOn": [], + "options": { + "script": "dev" + } + }, + "preview": { + "executor": "nx:run-script", + "cache": false, + "dependsOn": [], + "options": { + "script": "preview" + } + } + } }