Reusable infrastructure foundation for Dockerized services, reverse proxy configuration, CI/CD workflows, monitoring, and Linux server management. https://xegames.online
This repository has been archived on 2026-06-14. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file Use this template
2026-05-18 10:13:46 -06:00
template Updated workflow based on errors found while implementing in node-nginx. 2026-05-18 05:48:33 -06:00
.gitignore Update .gitignore 2026-05-16 11:45:47 +00:00
LICENSE Initial commit 2026-05-16 11:44:46 +00:00
README.md Updated README to provide accurate setup instructions. 2026-05-18 10:13:46 -06:00

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 release branch 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 either vps or hub

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 release branch for deployments to work correctly.

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:

  1. SSH into the target server
  2. Pull the latest code from the release branch
  3. 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