mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-02 21:32:10 +03:00
- Add deploy-vps.yml: auto-deploys via SSH after Docker Hub publish - Remove API key management section from Endpoint page (now in API Manager) - Remove unused Link import from EndpointPageClient.tsx
45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
name: Deploy to VPS
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["Publish to Docker Hub"]
|
|
types: [completed]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
|
name: Deploy OmniRoute to VPS
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install Tailscale
|
|
uses: tailscale/github-action@v3
|
|
with:
|
|
oauth-client-id: ""
|
|
oauth-secret: ""
|
|
tags: tag:ci-deploy
|
|
continue-on-error: true
|
|
|
|
- name: Deploy via SSH
|
|
uses: appleboy/ssh-action@v1
|
|
with:
|
|
host: ${{ secrets.VPS_HOST }}
|
|
username: ${{ secrets.VPS_USER }}
|
|
key: ${{ secrets.VPS_SSH_KEY }}
|
|
port: 22
|
|
timeout: 30s
|
|
script: |
|
|
echo "=== Updating OmniRoute ==="
|
|
npm install -g omniroute@latest 2>&1
|
|
INSTALLED_VERSION=$(omniroute --version 2>/dev/null || echo "unknown")
|
|
echo "Installed version: $INSTALLED_VERSION"
|
|
|
|
echo "=== Restarting PM2 ==="
|
|
pm2 restart omniroute || pm2 start omniroute --name omniroute -- --port 20128
|
|
pm2 save
|
|
|
|
echo "=== Health Check ==="
|
|
sleep 3
|
|
curl -sf http://localhost:20128/api/settings > /dev/null && echo "✅ OmniRoute is healthy" || echo "❌ Health check failed"
|
|
echo "=== Deploy complete ==="
|