deploy.cc / Generator
Deploy config generator
Pick a type, fill in options, get a ready-to-use file. Outputs are tested with actionlint, hadolint, systemd-analyze and docker build before release; action versions checked 2026-11-13.
Actions → Cloudflare PagesActions → GitHub PagesActions → SSH deploy to VPSActions → Docker build & pushDockerfiledocker-compose.ymlsystemd unitPM2 ecosystem
.github/workflows/deploy-vps.yml
# Deploy to a VPS over SSH (deploy.cc)
# Secrets: SSH_HOST, SSH_USER, SSH_PORT (optional), SSH_PRIVATE_KEY, SSH_KNOWN_HOSTS (output of: ssh-keyscan -p PORT HOST)
name: Deploy to VPS
on:
push:
branches: ['main']
workflow_dispatch:
permissions:
contents: read
concurrency:
group: deploy-vps
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '24'
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: 'npm run build'
- name: Set up SSH key
run: |
install -m 700 -d ~/.ssh
printf '%s\n' "$SSH_KEY" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
printf '%s\n' "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
env:
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }}
- name: Upload with rsync
run: |
rsync -az --delete -e "ssh -i ~/.ssh/deploy_key -p \"${SSH_PORT:-22}\"" dist/ "$SSH_USER@$SSH_HOST:/var/www/example.com/"
env:
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}
SSH_PORT: ${{ secrets.SSH_PORT }}
- Create a dedicated deploy user and key pair; put the public key in authorized_keys and the private key in SSH_PRIVATE_KEY.
- Fill SSH_KNOWN_HOSTS from ssh-keyscan instead of disabling host key checking.
- rsync --delete removes extra files in the target directory.
- npm ci and the setup-node npm cache need a committed package-lock.json.
Inputs are restricted to safe characters; invalid values fall back to defaults.