Skip to content

VPS Deployment & Webhooks

Deployments for Planovi Webpage are fully automated. Pushing changes to the GitHub repository triggers an instantaneous update on the central Hostinger VPS (191.218.165.149).


1. Automated GitHub Webhook Deployment

The VPS runs a Python-based webhook daemon (vps-deployer on port 9000):

sequenceDiagram
    autonumber
    actor Dev as Developer
    participant GH as "GitHub (PA-IDEAS/planovi-webpage)"
    participant VPS as "VPS Deployer (:9000)"
    participant Server as "/opt/vps-apps/webpage"

    Dev->>GH: git push origin main (or dev)
    GH->>VPS: POST /webhook (X-Hub-Signature-256)
    VPS->>VPS: Validate HMAC SHA-256 signature
    VPS->>Server: git pull origin [branch]
    VPS->>Server: Set file permissions (chown www-data)
    VPS-->>GH: 200 OK (Deployment Success)

2. Server Directory Mapping

BranchVPS File PathPublic Domain / URL
main/opt/vps-apps/webpage/prodhttps://planovi.app
dev/opt/vps-apps/webpage/devhttps://dev-webpage.planovi.app

3. Webhook Runner Specification

The webhook server evaluates incoming GitHub payloads and executes the following sequence:

Terminal window
# Automated deployment script executed by vps-deployer
cd /opt/vps-apps/webpage/prod
git fetch origin main
git reset --hard origin/main
chmod -R 755 .
docker exec vps-proxy nginx -s reload

Because PHP files are interpreted at runtime by PHP-FPM and static assets are served directly through Nginx, zero service restart is required. The reload is 100% zero-downtime.


4. Manual / FTP Fallback Deployment (deploy.sh)

In the event of an SSH or webhook outage, a legacy FTP synchronization script is maintained at the repository root:

Terminal window
./deploy.sh

The script iterates through all non-hidden project files and uploads changed assets via curl --ftp-create-dirs directly to the Hostinger FTP endpoint (145.14.153.31).