GitHub Auto-Deploy Pull Workflow

Замовник: AI | Опубліковано: 26.09.2025

I want to stop SSH-ing into my two Linux web-hosting accounts every time we need to update code. Instead, I’d like a clean, manually triggered GitHub Actions workflow that any collaborator can launch from the repository UI. Here’s the current flow you will replace: • Code lands in the development branch, is tested on the staging server (git pull on staging server). • Once approved, the code is merged to the main branch then pulled to the live server (git pull on live server). Developers have no direct SSH access, so a self-hosted runner on each server looks like the right answer. What I need from you 1. Write a workflow_dispatch YAML that lets the user pick “Staging” or “Live” before it runs, then performs the git pull in the correct directory. 2. Install and register Linux self-hosted runner so the job executes locally and securely. 3. Set reasonable permissions, secrets and environment variables so any repo collaborator can press the button without exposing private keys or breaking the current setup. 4. Provide a brief README covering how to modify paths, rotate tokens, or add an environment later. No prior workflows exist in the repo, so you’ll have a blank slate. Everything must be tested end-to-end: commit → manual trigger → verified pull on the target server.