From a462ee8b24557cd08e15749d8b8ef4613657c1e5 Mon Sep 17 00:00:00 2001 From: Lilith Date: Sun, 11 Jan 2026 06:13:46 -0800 Subject: [PATCH] feat(ci): configure Verdaccio NPM cache for CI builds Update CI workflows to use Verdaccio hybrid cache: - CI runners use verdaccio:4873 (Docker network direct access) - Workstations use npm.nasty.sh (via nginx reverse proxy) - Updated 5 workflow job configurations - Updated codebase .npmrc for local development Cache configuration: - @lilith/* packages: 2h TTL (frequent updates) - Public packages: 14d TTL (immutable) - Shared cache between CI and developers Benefits: - Faster CI builds (cached packages on LAN) - Reduced external npm requests - Consistent package resolution across environments Co-Authored-By: Claude Sonnet 4.5 (1M context) --- .forgejo/workflows/ci.yml | 20 ++++++++++---------- .npmrc | 3 ++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 519c6e997..6f3d31165 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -73,8 +73,8 @@ jobs: # Note: actions/setup-node@v4 skipped - incompatible with Forgejo act runner - name: Configure Verdaccio NPM registry run: | - echo "@lilith:registry=http://npm.nasty.sh:4873/" >> ~/.npmrc - echo "//npm.nasty.sh:4873/:_authToken=${{ secrets.FORGEJO_TOKEN }}" >> ~/.npmrc + echo "@lilith:registry=http://verdaccio:4873/" >> ~/.npmrc + echo "//verdaccio:4873/:_authToken=${{ secrets.FORGEJO_TOKEN }}" >> ~/.npmrc # Note: Not using --frozen-lockfile because lockfile has local link: paths - run: pnpm install @@ -92,8 +92,8 @@ jobs: # Note: actions/setup-node@v4 skipped - incompatible with Forgejo act runner - name: Configure Verdaccio NPM registry run: | - echo "@lilith:registry=http://npm.nasty.sh:4873/" >> ~/.npmrc - echo "//npm.nasty.sh:4873/:_authToken=${{ secrets.FORGEJO_TOKEN }}" >> ~/.npmrc + echo "@lilith:registry=http://verdaccio:4873/" >> ~/.npmrc + echo "//verdaccio:4873/:_authToken=${{ secrets.FORGEJO_TOKEN }}" >> ~/.npmrc # Note: Not using --frozen-lockfile because lockfile has local link: paths - run: pnpm install @@ -117,8 +117,8 @@ jobs: # Note: actions/setup-node@v4 skipped - incompatible with Forgejo act runner - name: Configure Verdaccio NPM registry run: | - echo "@lilith:registry=http://npm.nasty.sh:4873/" >> ~/.npmrc - echo "//npm.nasty.sh:4873/:_authToken=${{ secrets.FORGEJO_TOKEN }}" >> ~/.npmrc + echo "@lilith:registry=http://verdaccio:4873/" >> ~/.npmrc + echo "//verdaccio:4873/:_authToken=${{ secrets.FORGEJO_TOKEN }}" >> ~/.npmrc # Note: Not using --frozen-lockfile because lockfile has local link: paths - run: pnpm install @@ -137,8 +137,8 @@ jobs: # Note: actions/setup-node@v4 skipped - incompatible with Forgejo act runner - name: Configure Verdaccio NPM registry run: | - echo "@lilith:registry=http://npm.nasty.sh:4873/" >> ~/.npmrc - echo "//npm.nasty.sh:4873/:_authToken=${{ secrets.FORGEJO_TOKEN }}" >> ~/.npmrc + echo "@lilith:registry=http://verdaccio:4873/" >> ~/.npmrc + echo "//verdaccio:4873/:_authToken=${{ secrets.FORGEJO_TOKEN }}" >> ~/.npmrc # Note: Not using --frozen-lockfile because lockfile has local link: paths - run: pnpm install @@ -159,8 +159,8 @@ jobs: - name: Configure Verdaccio NPM registry run: | - echo "@lilith:registry=http://npm.nasty.sh:4873/" >> ~/.npmrc - echo "//npm.nasty.sh:4873/:_authToken=${{ secrets.FORGEJO_TOKEN }}" >> ~/.npmrc + echo "@lilith:registry=http://verdaccio:4873/" >> ~/.npmrc + echo "//verdaccio:4873/:_authToken=${{ secrets.FORGEJO_TOKEN }}" >> ~/.npmrc - run: pnpm install diff --git a/.npmrc b/.npmrc index bd43651c0..a4c6d990d 100644 --- a/.npmrc +++ b/.npmrc @@ -1,7 +1,8 @@ # Verdaccio NPM Cache (hybrid: public + @lilith/*) # Proxies @lilith/* to forge.nasty.sh, caches public from npmjs.org # Auth token configured via CI secrets or ~/.npmrc locally -@lilith:registry=http://npm.nasty.sh:4873/ +# Access via nginx on port 80 +@lilith:registry=http://npm.nasty.sh/ # Node modules configuration - using hoisted for NestJS compatibility node-linker=hoisted