This guide use https://github.com/appleboy/ssh-action to deploy this repository, you can modify the commands as you want.
- Create a
/.github/workflows/deployment.yml
- Setup in Github Secrets:
- SERVER_IP: Server IP Address
- SERVER_USERNAME: Username
- SERVER_PASSWORD: Password
- PROJECT_PATH: Project path
- Review de
Actions
tabs each time the deploy runs.
- Clone the repository with the user you wanna to use the app. This user should be the same Github Action will use each time the pipeline runs.
- Setup PM2 and run the NodeJs project: Example:
pm2 start src/app.js --recetasapp
- Be sure the app is running. List running apps:
pm2 ls
- Be sure the Github user has access and pass between restarts to the repository:
ssh -T [email protected]
should print the user.