How illeniumstudios/fivem-resource-watcher works
1. This repository is a GitHub Action that automates FiveM resource restarts after repository changes. Its core responsibility is change detection plus issuing the appropriate restart command against a FiveM server.
2. The action is packaged for GitHub Actions execution using a Dockerfile and entrypoint.sh, with action.yml serving as the action manifest. That means the runtime boundary is the GitHub Actions runner, while the action logic itself is encapsulated in the container/entrypoint layer.
3. The main input boundary is the action configuration: server address/port, resource folder name, resource ignore list, and restart mode flags. The action is controlled by GitHub Actions secrets and workflow context rather than by a standalone CLI or daemon.
4. The primary data flow is: GitHub push event → action receives the previous commit SHA via GITHUB_EVENT_BEFORE → action determines which files/resources changed → action decides whether to restart individual resources or the whole server. The restartServerWhen0Players option can override normal resource-level restarts when the server is empty.
5. Resource-level targeting is centered on a configurable resources directory, defaulting to resources. The action maps repository changes into the corresponding FiveM resource boundaries and can exclude specific resources via resourcesToIgnore.
6. The server-control boundary is FiveM RCON. The repository docs require rcon_password on the server and an RCON_PASSWORD secret in GitHub, so the action’s effect is mediated through the FiveM server’s remote command interface rather than direct filesystem manipulation.
7. The remote deployment step is intentionally separate from the restart step. The README’s example workflow first uses SSH to git pull updated code onto the server, then runs this action to restart only what changed. That creates a two-stage pipeline: sync code first, then apply runtime reloads.
8. SSH is not part of the action’s core restart logic, but it is an important adjacent subsystem in the overall deployment architecture described by the repo. The provided examples use appleboy/ssh-action to connect to either Linux or Windows servers, with password- or key-based authentication.
9. The repository includes example-pipelines/ with sample workflow YAMLs that demonstrate the intended integration pattern. These examples act as reference architecture for how the action is consumed in real CI/CD pipelines.
10. The external system boundaries are the GitHub repository, the remote VPS/dedicated server, and the live FiveM server process. The action sits in the middle, translating repository diffs into RCON restart commands after the server code has been pulled onto the machine.
11. Operationally, the architecture assumes the server process and the repository checkout are already linked on the host. The action does not deploy files itself; it coordinates post-pull restarts based on repository change metadata.
12. In diagram terms, the central components are: GitHub push trigger, GitHub Action container, diff/change analysis, restart decision logic, and FiveM RCON target. Surrounding these are the SSH-based sync step, repository secrets, and the server-side repo checkout that makes the restarted code live.
Main entry points: entrypoint.sh Entrypoint · action.yml Action spec · example-pipelines Example workflows · Dockerfile Action image
Components 16
GitHub / CI
Workflow trigger and action packaging on GitHub
- Push event · Repository change event that starts the workflow
- Before SHA · Previous commit reference from the GitHub event payload
Action runtime
Container entrypoint and restart logic
- Action spec · GitHub Actions metadata and input contract
action.yml - Action image · Packaged execution environment for the action
Dockerfile - Entrypoint · Container entry script that runs the action logic
entrypoint.sh - Action inputs · Server, resource, ignore, and restart flags plus secrets
- Change scan · Determines which files and resources changed
- Resource map · Maps changed paths into FiveM resource boundaries
- Ignore list · Excludes configured resources from restart decisions
- Restart logic · Chooses resource-level restart or full server restart
- Empty-server rule · Forces server restart behavior when the server has 0 players
Deployment target
Remote host and FiveM server boundary
- RCON command · Issues restart commands through FiveM RCON
- Server checkout · Repository copy already present on the remote host
- FiveM server · Live server process that receives restart commands
- SSH sync · Pulls updated code onto the remote host before restart
Examples
Reference pipeline integrations
- Example workflows · Reference GitHub Actions pipelines for Linux and Windows setups
example-pipelines
Connections 18
- Push event → Before SHA: provides · Workflow uses the previous commit from the event payload
- Push event → Action spec: starts · Repository event launches the GitHub Action
- Action spec → Action image: runs in · Action metadata selects the containerized runtime
- Action image → Entrypoint: launches · Container starts the shell entrypoint
- Entrypoint → Action inputs: reads · Entrypoint consumes action inputs and secrets
- Entrypoint → Change scan: invokes · Runtime begins change detection
- Before SHA → Change scan: bounds · Previous SHA defines the diff range
- Change scan → Resource map: feeds · Changed paths are mapped to resource boundaries
- Resource map → Ignore list: filters · Configured ignore list removes excluded resources
- Resource map → Restart logic: inputs · Resource-level impacts drive restart selection
- Action inputs → Restart logic: controls · Flags and server settings influence restart policy
- Empty-server rule → Restart logic: overrides · Empty-server mode can supersede normal resource restarts
- Restart logic → RCON command: emits · Chosen restart action is sent as an RCON command
- RCON command → FiveM server: targets · Remote control interface reaches the live server process
- SSH sync → Server checkout: updates · SSH step pulls repository changes onto the host
- Server checkout → FiveM server: serves · Server restarts apply to the already-synced checkout
- Example workflows → SSH sync: demonstrates · Examples show the code-sync step before restart
- Example workflows → Action spec: uses · Examples illustrate how the action is wired into workflows