diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9dd9e53 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# Container image that runs your code +FROM alpine:3.17 + +RUN apk add --no-cache curl tar + +ARG RCON_VERSION="0.10.2" + +RUN curl -LO https://github.com/gorcon/rcon-cli/releases/download/v${RCON_VERSION}/rcon-${RCON_VERSION}-amd64_linux.tar.gz && \ + tar -xvf rcon-${RCON_VERSION}-amd64_linux.tar.gz && \ + mv rcon-${RCON_VERSION}-amd64_linux/rcon /usr/local/bin/ && \ + rm -rf rcon-${RCON_VERSION}-amd64_linux* + +# Copies your code file from your action repository to the filesystem path `/` of the container +COPY entrypoint.sh /entrypoint.sh + +# Code file to execute when the docker container starts up (`entrypoint.sh`) +ENTRYPOINT ["/entrypoint.sh"] diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..d7097a4 --- /dev/null +++ b/action.yml @@ -0,0 +1,27 @@ +name: "FiveM Resource Watcher" +description: "Watches for changed resources and restarts them" +inputs: + restartIndividualResources: + description: "Restart resources individually or restart the whole server" + required: false + default: true + serverIP: + description: "IP of the FiveM server" + required: true + default: "" + serverPort: + description: "Port of the FiveM server" + required: false + default: 30120 + rconPassword: + description: "Password that you have set for rcon" + required: true + default: "" +runs: + using: "docker" + image: "Dockerfile" + args: + - ${{ inputs.restartIndividualResources }} + - ${{ inputs.serverIP }} + - ${{ inputs.serverPort }} + - ${{ inputs.rconPassword }} diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..6a6acee --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh -l + +echo "$1" +echo "$2" +echo "$3" +echo "$4"