Prompt

I'm building a Node app and need auto deploys from GitHub

Technology / Cloud Infrastructure1 observationLast seen Oct 7, 2026

Latest observation

Oct 7, 2026OpenAI APIWeb search: off

Here’s the simplest reliable way to get auto-deploys from GitHub for a Node app. I’ll give you a practical setup that works well on a VPS or cloud VM.

Recommended approach

Use:

  • GitHub repo
  • GitHub Actions to deploy on push
  • A server running your Node app with either:
    • PM2 to keep it running, or
    • Docker if you prefer containers

Basic flow

  1. You push to main
  2. GitHub Actions runs tests/build
  3. It SSHes into your server
  4. Pulls the latest code
  5. Installs dependencies / builds
  6. Restarts the app

Option A: Deploy with SSH + PM2

1) Set up your Node app on the server

On your server:

git clone git@github.com:yourname/yourrepo.git
cd yourrepo
npm install
npm run build   # if applicable
npm install -g pm2
pm2 start app.js --name my-app
pm2 save
pm2 startup

If you use npm start, then:

pm2 start npm --name my-app -- start

2) Add secrets to GitHub

In your GitHub repo go to:

Settings → Secrets and variables → Actions → New repository secret

Add:

  • SSH_HOST = your server IP/domain
  • SSH_USER = server username
  • SSH_KEY = private SSH key
  • SSH_PORT = 22 or custom port

3) Create a GitHub Actions workflow

Create this file:

.github/workflows/deploy.yml

name: Deploy Node App

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up Node
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Install dependencies
        run: npm ci

      - name: Build
        run: npm run build --if-present

      - name: Deploy via SSH
        uses: appleboy/ssh-action@v1.0.3
        with:
          host: ${{ secrets.SSH_HOST }}
          username: ${{ secrets.SSH_USER }}
          key: ${{ secrets.SSH_KEY }}
          port: ${{ secrets.SSH_PORT }}
          script: |
            cd /var/www/yourrepo
            git pull origin main
            npm ci --omit=dev
            npm run build --if-present
            pm2 restart my-app --update-env

Option B: Deploy with Docker

If you already use Docker, build the image in GitHub Actions and push it to a registry (like GHCR), then pull and restart on the server.

This is better if you want:

  • consistent environments
  • easier rollbacks
  • cleaner production setup

Good practices

  • Use a production branch like main
  • Add a npm test step before deploy
  • Keep environment variables in:
    • GitHub Secrets
    • server .env
  • Use a process manager like PM2
  • Set up logs/monitoring

Important note

If your app needs:

  • database migrations
  • caching
  • asset building
  • restart on config changes

then include those in the deployment script.

Example:

git pull origin main
npm ci --omit=dev
npm run migrate
npm run build --if-present
pm2 restart my-app --update-env

If you want the easiest possible setup

Tell me which environment you’re using:

  1. VPS / Ubuntu server
  2. Docker
  3. Vercel / Render / Railway / Fly.io
  4. AWS / GCP / Azure

And I’ll give you an exact step-by-step deployment config for that platform.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.