Skip to content
New issue

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

Server Deploy to Node.js on cPanel using this not working #477

Open
lightmanBro opened this issue Aug 20, 2024 · 0 comments
Open

Server Deploy to Node.js on cPanel using this not working #477

lightmanBro opened this issue Aug 20, 2024 · 0 comments

Comments

@lightmanBro
Copy link

name: 🚀 Deploy Node.js Server on Push

on:
push:
branches:
- main

jobs:
web-deploy:
name: Deploy Node.js Server
runs-on: ubuntu-latest
steps:
- name: Get latest code
uses: actions/checkout@v3

  - name: Set up Node.js 16
    uses: actions/setup-node@v3
    with:
      node-version: '18'

  - name: Install dependencies
    run: npm install

  - name: Sync files to cPanel
    uses: SamKirkland/FTP-Deploy-Action@v4.3.4
    with:
      server: ${{ secrets.GIT_CPANEL_SERVER }}
      username: ${{ secrets.GIT_CPANEL_USERNAME }}
      password: ${{ secrets.GIT_CPANEL_PASSWORD }}
      protocol: ftp  # or 'sftp' based on your cPanel configuration
      local-dir: ./
      server-dir: ./
      security: loose

  - name: Install dependencies on cPanel server
    run: |
      ssh ${{ secrets.GIT_CPANEL_USERNAME }}@${{ secrets.GIT_CPANEL_SERVER }} "cd ~/nodejsapps/servertest.citratechsolar.com/ && npm install"

  - name: Restart Node.js server
    run: |
      ssh ${{ secrets.GIT_CPANEL_USERNAME }}@${{ secrets.GIT_CPANEL_SERVER }} "cd ~/nodejsapps/servertest.citratechsolar.com/ && npm run start"

Screenshot_20-8-2024_194626_github com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant