Skip to main content
Servers Are Up
Virtual Datacenter
PricingFree Tools
Sign inBrowse catalog
Servers Are Up
Virtual Datacenter
PricingFree Tools
Sign inBrowse catalog

Loading…

Servers Are Up

Your apps, automation and data on hardware we own. Build a private stack with predictable capacity and access through your dashboard, API or SSH.

SLA with service creditsOwned hardwareUS-based

Make room for your next idea

Explore the capacity, apps and access options that fit your workload. Check current availability and your total before you buy.

Sign up freeView Pricing

Products

  • Linux VPS
  • Windows VPS
  • Cloud & SaaS Services
  • Cloud Storage (Azure)
  • Virtual Datacenter
  • AI & Agent Hosting
  • Containers
  • Instant Apps
  • Software Platforms
  • Network builder
  • Game Servers
  • Free Game Servers
  • Pricing

Resources

  • Free Network Tools
  • 2026 Pricing Benchmark
  • Live SVG Badges
  • Latency & Speed Test
  • Guides & Tutorials
  • Documentation
  • API Reference
  • MCP Server
  • CLI & SDKs
  • OpenAPI & llms.txt
  • Use Cases
  • Free Migration
  • Uptime & Reliability
  • Datacenter
  • System Status
  • Network
  • Provider Comparisons Hub
  • Compare Providers

Company

  • About Us
  • Enterprise
  • Security Architecture
  • Trust Center
  • Blog
  • FAQ
  • Compliance
  • Startup Program
  • Open-Source Sponsorship
  • Press & Media Kit
  • Referral Program
  • Help Center
  • Contact Us
© Servers Are Up
TermsPrivacySLARefund PolicyDPAAcceptable Use
Service information
Docs
  • Documentation Hub
  • Technical Knowledge Library
    Runbooks & 187 Blueprints
  • Choose a Product
    VMs, Containers & Cloud
  • First Linux Server
    SSH, Firewall & Apps
  • Windows Server 2025
    BYOL & Remote Desktop
  • Remote Access
  • Troubleshooting
  • FAQ
  • All Product Guides
    29 Step-by-Step Guides
  • Cloud & SaaS Catalog
    112 Cloud & SaaS Offerings
  • Azure Cloud Storage
    Hot/Cool/Archive & WORM
  • Resource Manager & RBAC
    Groups, Tags & Locks
  • Multi-Model Cloud DB
    JSONB, SQL & pgvector
  • Cloud Identity & ZTNA
    OIDC, SCIM & PIM
  • Key Vault & KMS
    Secrets & Envelope Keys
  • Cloud SIEM, SOAR & DLP
    Posture & Threat Response
  • API Gateway & Cloud DNS
    Edge WAF & DNS Zones
  • Serverless, Workflows & IoT
    Functions, Queues & DAGs
  • SaaS, Governance & Vault
    Budgets & Off-Host GRS
  • Linux Systems & Kernel
    SSH, UFW, sysctl & OOM
  • Self-Hosted Apps & Stacks
    Caddy, Nextcloud & Auth
  • Build Web Apps with AI
  • Next.js and React
  • TypeScript and Node.js
  • npm and Tooling
  • Data and APIs
  • Deploy and Operate
  • Tutorials
  • Infrastructure
  • Automation & Regions
  • API Overview
  • API v1 Reference
    Endpoints & 23 Scopes
  • MCP Server
    129 AI Agent Tools
  • Swagger / OpenAPI 3.1
  • API Playground
  • Versioning & Sunset
  • API Token Security
    Authentication & Tokens
  • Instances API
    Compute Resources
  • Networking API
    Networks & Ports
  • Storage API Availability
    Volumes & Backups
  • Webhooks & Events
    Event Notifications
  • Rate Limits & Best Practices
    Throttling & Retries
  • sau CLI Reference
    34 Commands (v0.2)
  • Browser Web CLI
  • SDKs
  • Infrastructure as Code
    Terraform & Ansible
  • Code Examples
  • CLI & SDK Guides
  • Security Guides
  • Security at a Glance
  • Zero Trust Architecture
  • Live Trust Center
  • Compliance
Need help?

Loading documentation...

Documentation/tutorials

Build CI/CD Pipeline

Automate builds, tests, and deployments with CI/CD best practices.

Intermediate
12 min
Updated 2026-10-27

Deploy Ready-to-Run Infrastructure in Seconds

Linux VMs from $6/mo · Pooled Virtual Datacenters from $12/mo · Use code WELCOME20 for 20% off your first order.

Browse ServersView Pricing

Automate building, testing and deploying your application to a Servers Are Up server using GitHub Actions.

Overview

This tutorial sets up a pipeline that:

  1. Runs tests on every pull request
  2. Builds on every push to main
  3. Deploys to your server over SSH

Prerequisites

  • A GitHub repository with your application
  • A server set up as in Deploy Next.js: the deploy user, the nextjs service and /home/deploy/deploy.sh
  • Public SSH turned on for the server. GitHub's hosted runners connect from many addresses, so its Who can connect must admit them (anyone, or a self-hosted runner's address)

Step 1: Set Up an SSH Key for Deployments

On your own computer, generate a key used only for deployments:

ssh-keygen -t ed25519 -C "github-deploy" -f deploy_key -N ""

On the server, in the root shell from How to connect and sudo -i, let that key sign in as deploy. Paste the whole line of deploy_key.pub in place of PUBLIC_KEY_LINE:

install -d -m 700 -o deploy -g deploy /home/deploy/.ssh
echo 'PUBLIC_KEY_LINE' >> /home/deploy/.ssh/authorized_keys
chown deploy:deploy /home/deploy/.ssh/authorized_keys
chmod 600 /home/deploy/.ssh/authorized_keys

In your GitHub repository, go to Settings > Secrets and variables > Actions and add:

Secret Value
DEPLOY_SSH_KEY Contents of deploy_key (the private key)
DEPLOY_HOST The address in the server's How to connect command
DEPLOY_PORT The port in that command (after -p)
DEPLOY_USER deploy

Step 2: Create the Workflow

Create .github/workflows/deploy.yml:

name: Build & Deploy

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 24
          cache: npm
      - run: npm ci
      - run: npm test
      - run: npm run lint

  build-and-deploy:
    needs: test
    if: github.ref == 'refs/heads/main' && github.event_name == 'push'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 24
          cache: npm
      - run: npm ci
      - run: npm run build

      - name: Deploy via SSH
        uses: appleboy/ssh-action@v1
        with:
          host: ${{ secrets.DEPLOY_HOST }}
          port: ${{ secrets.DEPLOY_PORT }}
          username: ${{ secrets.DEPLOY_USER }}
          key: ${{ secrets.DEPLOY_SSH_KEY }}
          script: /home/deploy/deploy.sh

The build on GitHub catches a broken build before it reaches the server; the server builds again in deploy.sh, from the same commit.

Step 3: Docker-Based Deployments (Alternative)

If your app ships as a Docker image, install Docker on the server (apt update && apt install -y docker.io, then usermod -aG docker deploy), log the server in to your registry once, and deploy the image instead:

  build-and-push:
    needs: test
    if: github.ref == 'refs/heads/main' && github.event_name == 'push'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Build and push Docker image
        run: |
          echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login your-registry -u "${{ secrets.REGISTRY_USER }}" --password-stdin
          docker build -t your-registry/app:${{ github.sha }} .
          docker push your-registry/app:${{ github.sha }}

      - name: Deploy container
        uses: appleboy/ssh-action@v1
        with:
          host: ${{ secrets.DEPLOY_HOST }}
          port: ${{ secrets.DEPLOY_PORT }}
          username: ${{ secrets.DEPLOY_USER }}
          key: ${{ secrets.DEPLOY_SSH_KEY }}
          script: |
            docker pull your-registry/app:${{ github.sha }}
            docker stop app || true
            docker rm app || true
            docker run -d --name app --restart unless-stopped -p 3000:3000 \
              --env-file /home/deploy/.env \
              your-registry/app:${{ github.sha }}

The container listens on port 3000, so the forward from Deploy Next.js keeps working.

Step 4: Add Deployment Notifications

Add a final step to the deploy job to notify your team:

      - name: Notify deployment
        if: success()
        run: |
          curl -X POST "${{ secrets.WEBHOOK_URL }}" \
            -H 'Content-Type: application/json' \
            -d '{"text": "Deployed commit ${{ github.sha }} to production"}'

Best Practices

  • Never commit secrets: use GitHub encrypted secrets or environment variables
  • Pin action versions: to a commit SHA or a major version (e.g. @v4)
  • Add health checks: verify the deployment is healthy before marking it as complete
  • Use branch protection rules: require passing CI before merging
  • Stop on the first failure: deploy.sh exits at the first failing step and restarts nothing

Next Steps

  • GitHub Actions Integration
  • GitLab CI/CD Integration
  • Monitoring

Related Articles

GitHub Actions Integration

Read more

GitLab CI/CD Integration

Read more

Monitoring

Read more

Frequently Asked Questions

What does the Build CI/CD Pipeline documentation guide cover?
Automate builds, tests, and deployments with CI/CD best practices. It is rated intermediate difficulty (12 min) and applies to Servers Are Up infrastructure and workflows.
Can I manage or automate these steps through the Servers Are Up dashboard, REST API v1, or MCP server?
Yes. Every Servers Are Up server includes browser-based SSH, WebRDP, and VNC console access in the dashboard, plus programmatic control via the REST API v1 (/api/v1) and hosted Model Context Protocol server (/api/mcp/v1) using a scoped Personal Access Token.

Need hands-on help with Build CI/CD Pipeline?

Every Servers Are Up virtual machine and container includes an integrated HTML5 browser-based SSH, RDP, and VNC console in your dashboard, default-off inbound firewall rules with per-IP allow-lists, and full programmatic control via REST API v1 and Model Context Protocol (MCP). Explore our Virtual Datacenter Plans or reach out to Servers Are Up Support.

Was this article helpful?

On this page

OverviewPrerequisitesStep 1: Set Up an SSH Key for DeploymentsStep 2: Create the WorkflowStep 3: Docker-Based Deployments (Alternative)Step 4: Add Deployment NotificationsBest PracticesNext Steps
Need Live Commands?

Open Aria in Wide Engineering Mode for distro-specific commands, compose tweaks, and isolated environment troubleshooting.

Knowledge Library