Stackrium Logo Stackrium

Automating CI/CD Deployments using GitHub Webhooks

S
Stackrium Engineering
Published on Oct 22, 2026 CI/CD

Manually uploading files via FTP or File Manager is slow and prone to human error. Modern web development relies on Continuous Deployment (CD). With Stackrium, you can link your domains directly to GitHub or GitLab repositories.

The "One User, One Identity" Architecture

Stackrium takes security very seriously. To clone private repositories, your server needs an SSH key authorized by GitHub.

Instead of generating a global root key (which is a massive security risk), Stackrium enforces a "One User, One Identity" rule. Each system user generated in Stackrium is automatically assigned their own unique ED25519 SSH Deploy Key.

Security Rule: If you are deploying two different private repositories to two different domains, you must create a separate System User for each project. This ensures that a compromise on Website A cannot be used to access the source code for Website B.

Step 1: Adding the Deploy Key

  1. In Stackrium, go to the Web & Git tab, click the Git icon next to your domain.
  2. Copy the generated ED25519 SSH Public Key.
  3. Go to your repository on GitHub.
  4. Navigate to Settings -> Deploy Keys and click Add deploy key.
  5. Paste the key and name it "Stackrium Production". (You do not need to grant write access).

Step 2: The Initial Clone

Return to the Git modal in Stackrium. Enter your repository's SSH URL (e.g., git@github.com:Username/repo.git) and specify the branch you want to track (usually main or master).

Click Clone Repository. Stackrium will wipe the public_html folder and pull your code securely.

Step 3: Activating the Auto-Deploy Webhook

To make the process automatic, we need GitHub to ping Stackrium every time a developer merges code.

  1. Once the repository is cloned, Stackrium will display a Unique Webhook URL for that domain. Copy it.
  2. Go back to your GitHub repository settings.
  3. Navigate to Settings -> Webhooks and click Add webhook.
  4. In the "Payload URL" field, paste your Stackrium Webhook URL.
  5. Crucial: Change the "Content type" dropdown from `application/x-www-form-urlencoded` to application/json.
  6. Select "Just the push event" and save.

Conclusion

You're done! The next time a developer pushes code to your tracked branch, GitHub will send a JSON payload to your server. Stackrium's daemon intercepts this payload, verifies it, and automatically executes a git pull command inside your jailed user's directory.

Back to Tutorials