Repository navigation
chore(workflows): Fix production release setup - #301
Merged
Merged
Conversation
With HOME=/root the production deploy got past git but failed at npm ci with "npm: command not found": node is installed through NVM under the deploy user, not system-wide, and the app runs in that user's pm2. Use the same remote command as deploy-staging.yml: export HOME for the deploy user, load NVM from their home, and restart pm2 as that user. Closes #300
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
Ayush8923
approved these changes
Oct 30, 2026
|
🎉 This PR is included in version 0.6.2-main.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Closes #300
Summary
npm: command not found..github/workflows/create-release.ymlwithdeploy-staging.yml:ROOT_USER: ${{ secrets.USER }}with guard for missing secret.HOME=/home/$ROOT_USERfor global git config.export NVM_DIR=/home/$ROOT_USER/.nvm && . $NVM_DIR/nvm.shfor correct node and npm access.sudo -iu $ROOT_USER pm2 restart $APP_NAMEto restart the app under the deploy user's pm2.Checklist
Before submitting a pull request, please ensure that you mark these task.
npm run devandnpm run buildin the repository root and test.Original PR description
Issue
Closes #300
Summary
The
v0.6.1production release failed withnpm: command not found(exit 127). #299 fixed the$HOME not seterror by running as root withHOME=/root. Git now gets throughfetchandcheckout, but on the production host node is installed through NVM under the deploy user, so root has nonpm. The app also runs in that user's pm2, so a rootpm2 restartwould fail next.This PR makes the production remote command in
.github/workflows/create-release.ymlthe same asdeploy-staging.yml, which deploys fine. It also matches what production ran before #292:ROOT_USER: ${{ secrets.USER }}, with a guard if the secret is missing.USERalready exists in theAWS_ENVenvironment.export HOME=/home/$ROOT_USER: git--globalconfig still works.export NVM_DIR=/home/$ROOT_USER/.nvm && . $NVM_DIR/nvm.sh: givesnpm ci/npm run buildthe right node and npm.sudo -iu $ROOT_USER pm2 restart $APP_NAME: restarts the app in the deploy user's pm2.Checklist
npm run devandnpm run buildin the repository root and test.Notes
deploy-staging.yml. It can only be fully tested by a real release run.v0.5.0. The server repo is checked out at7c29ec6, but.nextis the old build and pm2 was not restarted, so nothing user-facing changed.v0.6.2. Re-runningv0.6.1uses the workflow file from that tag's commit and would fail the same way.