Skip to content

Deployment Strategies

This guide provides the exact configuration files you need to deploy this documentation site to either a Linode VPS (via GitHub Actions) or Netlify.


Option 1: Linode VPS (GitHub Actions)

This workflow listens for a git push to your main branch, builds the site inside a GitHub runner, and uses rsync to securely copy the static HTML to your server.

1. Prerequisites

On your GitHub Repo, go to Settings > Secrets and variables > Actions and add these "Repository secrets":

  • SSH_PRIVATE_KEY: Your SSH private key (ensure the public key is in ~/.ssh/authorized_keys on Linode).
  • SSH_HOST: Your Linode IP address.
  • SSH_USER: The username (e.g., root or admin).

2. The Workflow File

Create this file at: .github/workflows/deploy-linode.yml

yaml
name: Deploy to Linode

on:
  push:
    branches: [ main ]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: 'npm'

      - name: Install Dependencies
        run: npm ci

      - name: Build Site
        # This generates the static HTML in docs/.vitepress/dist
        run: npm run docs:build

      - name: Deploy to VPS via Rsync
        uses: easingthemes/ssh-deploy@v5.0.0
        with:
          # Private Key stored in GitHub Secrets
          SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
          # Source directory (The build output)
          SOURCE: "docs/.vitepress/dist/"
          # Target directory on your Linode
          TARGET: "/var/www/html/" 
          # Connection Details
          REMOTE_HOST: ${{ secrets.SSH_HOST }}
          REMOTE_USER: ${{ secrets.SSH_USER }}
          # Arguments: -r (recursive), -l (links), -t (times), -o/g (owner/group), -v (verbose)
          ARGS: "-rltgoDzvO --delete"

Option 2: Netlify (Zero Config)

Netlify is simpler because it detects the push automatically without a workflow file, but you need a configuration file to tell it how to build.

1. The Configuration File

Create this file at the root of your project: netlify.toml

toml
[build]
  # The command Netlify runs
  command = "npm run docs:build"
  
  # The directory where VitePress outputs the HTML
  publish = "docs/.vitepress/dist"

[context.production]
  environment = { NODE_VERSION = "20" }

2. Setup

  1. Log in to Netlify.
  2. Click "Add new site" $\to$ "Import from specific repository".
  3. Select your GitHub repo.
  4. Netlify will detect the netlify.toml and configure everything automatically.

Based on Kubernetes v1.35 (Timbernetes). Changelog.