- Shell 100%
| template | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
Template
Base template for XeplosionGames infrastructure repositories.
Overview
This template provides a standardized structure for all XeplosionGames infrastructure repositories, including automated deployment via Forgejo Actions and a customizable restart script.
Branch Structure
| Branch | Purpose | Auto-Deploy |
|---|---|---|
master |
Main development branch | ❌ |
release |
Production | ✅ |
Note: The
releasebranch is not created automatically from this template. It must be created manually after cloning.
Setup Instructions
When creating a new repo from this template:
1. Set repo-level secret
Go to Settings → Secrets in your repo and add:
DEPLOY_TARGET— set to eithervpsorhub
2. Move the workflow file
The workflow file is located in the templates/ folder. Move it to the correct location:
mkdir -p .forgejo/workflows
mv templates/.forgejo/workflows/deploy.yml .forgejo/workflows/deploy.yml
3. Configure the restart script
Edit scripts/restart.sh with the commands needed to restart your service:
nano scripts/restart.sh
4. Allow restart script to run without sudo password
Add a passwordless sudoers entry on the target server:
sudo visudo
Add:
xeplosion ALL=(ALL) NOPASSWD: /usr/bin/systemctl <action> <service>
5. Clone the repo on the target server
SSH into the target server and clone the repo:
cd ~
git clone git@git.xegames.online:XeplosionGames/REPO_NAME.git
Then add add push the release branch to the origin:
cd REPO_NAME
git -b checkout release
git push origin release
Important: The repo on the target server must be checked out on the
releasebranch for deployments to work correctly.
6. Set up symlinks
Link any config files from the repo to where the service expects them.
7. Delete template folder
After all of this is done, delete the existing template folder as it is no longer necessary.
Org-Level Secrets
These are inherited automatically from the XeplosionGames org and do not need to be set per repo:
| Secret | Description |
|---|---|
SSH_USER |
SSH username on the target server |
SSH_PORT |
SSH port on the target server |
SSH_PRIVATE_KEY |
Private key for SSH authentication |
VPS_HOST |
VPS server address |
HUB_HOST |
Hub server address |
Deployment
When a pull request is merged into release, the deploy workflow will automatically:
- SSH into the target server
- Pull the latest code from the
releasebranch - Run
scripts/restart.sh
You can also trigger a deploy manually by pushing directly to release:
git push origin release
Runner
Requires the forgejo-runner to be running on the target server. The runner is already configured on the VPS. For hub setup see the runner documentation.
File Structure
.
├── .forgejo/
│ └── workflows/
│ └── deploy.yml # Auto-deploy workflow (must be moved from templates/)
├── scripts/
│ └── restart.sh # Service restart script (customize per repo)
├── templates/
│ └── .forgejo/
│ └── workflows/
│ └── deploy.yml # Workflow template
└── README.md