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) <noreply@anthropic.com>
This commit is contained in:
Lilith 2026-01-11 06:13:46 -08:00
parent b3434e309b
commit a462ee8b24
2 changed files with 12 additions and 11 deletions

View file

@ -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

3
.npmrc
View file

@ -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