CI: auto-compute npmDepsHash on push to main #24
Labels
No labels
app:activities
app:chat
app:events
app:forum
app:libra
app:market
app:restaurant
app:tasks
app:wallet
app:webapp
bug
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
aiolabs/webapp#24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Every time
package.jsonorpackage-lock.jsonchanges, thenpmDepsHashin the deploy flake (server-deploy) must be manually updated. Forgetting this causes deploy failures with a hash mismatch error that requires finding and replacing hashes in multiple files.Proposed Solution
Add a Forgejo Actions workflow that:
mainwhenpackage-lock.jsonchangesnix run nixpkgs#prefetch-npm-deps -- package-lock.jsonnpm-deps-hash.txtin the repo rootThen update the NixOS webapp module (
webapp-module) to read the hash from the source:This eliminates the manual step — deploy flake hosts no longer need
npmDepsHashoverrides.Files affected
.forgejo/workflows/npm-hash.yml+npm-deps-hash.txtnpmDepsHashoverrides from host configs andwebapp-standalone.nixCurrent locations of manual hashes
server-deploy/modules/profiles/castle.nixserver-deploy/modules/services/webapp-standalone.nixserver-deploy/hosts/demo/default.nixserver-deploy/hosts/atio/default.nixManual workaround (until CI is implemented)
After changing npm dependencies in the webapp repo, run:
Then update the hash in all of these files in
server-deploy:Replace with the new hash and commit/push before deploying.