We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to deploy a front-end project to a remote server using Github Action, and I confirme that the remote server has downloaded pnpm.
Github Action:
- name: Deploy public uses: easingthemes/ssh-deploy@v4.1.8 env: IP: ${{ secrets.IP }} SSH_PRIVATE_KEY: ${{ env.SERVER_PRIVATE_KEY }} SOURCE: "pnpm-lock.yaml" REMOTE_HOST: ${{ env.SERVER_HOST }} REMOTE_USER: ${{ env.USER_NAME }} TARGET: '/home/ubuntu/test/' with: SCRIPT_AFTER: | cd /home/ubuntu/test pnpm start docker start nginx
Log:
Executing remote script: ssh -i /home/runner/.ssh/deploy_key_***_1691335359810 ***@*** ✅ [CMD] Remote script executed. nginx bash: line 2: pnpm: command not found ✅ [DONE]
The text was updated successfully, but these errors were encountered:
Hello @Laxy317 , I've the same issue of you but with npm and pm2, could you please share how you fixed it?
npm
pm2
My SCRIPT_AFTER is the following:
SCRIPT_AFTER: | pwd npm ci pm2 restart server
and I received
bash: line 2: npm: command not found bash: line 3: pm2: command not found
Thanks
Sorry, something went wrong.
The problem is caused by the library execute the after script using bash -c which by default does not load the user configurations.
bash -c
I solve thanks to this issue in ssh-action repository executing the following commands:
sudo ln -s "$NVM_DIR/versions/node/$(nvm version)/bin/node" "/usr/local/bin/node" sudo ln -s "$NVM_DIR/versions/node/$(nvm version)/bin/npm" "/usr/local/bin/npm" sudo ln -s "$NVM_DIR/versions/node/$(nvm version)/bin/pm2" "/usr/local/bin/pm2"
No branches or pull requests
I'm trying to deploy a front-end project to a remote server using Github Action, and I confirme that the remote server has downloaded pnpm.
Github Action:
Log:
The text was updated successfully, but these errors were encountered: