Skip to content

Commit

Permalink
feat: add hostname variable to MOTD HTML file
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanlinat committed May 1, 2024
1 parent 89fee0d commit 5bf6fa8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,29 @@ jobs:
- name: Generate the 'mapcycle.txt' file
run: ls dodserver/serverfiles/dod/maps/*.bsp | awk -F'/' '{ print $(NF) }' | sed 's/\.bsp$//' | shuf > dodserver/serverfiles/dod/mapcycle.txt
shell: bash
- name: Set random default map and max players for LinuxGSM
- name: "LinuxGSM: Set random default map and max players"
run: |
DEFAULT_MAP=$(shuf -n 1 dodserver/serverfiles/dod/mapcycle.txt)
export VPS_GAMESERVER_CONFIG_DEFAULT_MAP="$DEFAULT_MAP"
export VPS_GAMESERVER_CONFIG_MAX_PLAYERS="${{ vars.VPS_GAMESERVER_CONFIG_MAX_PLAYERS }}"
envsubst '$VPS_GAMESERVER_CONFIG_DEFAULT_MAP,$VPS_GAMESERVER_CONFIG_MAX_PLAYERS' < dodserver/lgsm/config-lgsm/dodserver/dodserver.cfg.template > dodserver/lgsm/config-lgsm/dodserver/dodserver.cfg
rm -f dodserver/lgsm/config-lgsm/dodserver/dodserver.cfg.template
shell: bash
- name: Set hostname, RCON password, and download URL for the gaming server
- name: "Server configuration: Set hostname, RCON password, and download URL"
run: |
export VPS_GAMESERVER_CONFIG_HOSTNAME="${{ vars.VPS_GAMESERVER_CONFIG_HOSTNAME }}"
export VPS_GAMESERVER_CONFIG_RCON_PASSWORD="${{ secrets.VPS_GAMESERVER_CONFIG_RCON_PASSWORD }}"
export VPS_GAMESERVER_CONFIG_DOWNLOAD_URL="${{ vars.VPS_GAMESERVER_CONFIG_DOWNLOAD_URL }}"
envsubst '$VPS_GAMESERVER_CONFIG_HOSTNAME,$VPS_GAMESERVER_CONFIG_RCON_PASSWORD,$VPS_GAMESERVER_CONFIG_DOWNLOAD_URL' < dodserver/serverfiles/dod/dodserver.cfg.template > dodserver/serverfiles/dod/dodserver.cfg
rm -f dodserver/serverfiles/dod/dodserver.cfg.template
shell: bash
- name: Set admin and moderator users for AMX Mod X
- name: "MOTD: Set meta title"
run: |
export VPS_GAMESERVER_CONFIG_HOSTNAME="${{ vars.VPS_GAMESERVER_CONFIG_HOSTNAME }}"
envsubst '$VPS_GAMESERVER_CONFIG_HOSTNAME' < dodserver/serverfiles/dod/motd.html.template > dodserver/serverfiles/dod/motd.html
rm -f dodserver/serverfiles/dod/motd.html.template
shell: bash
- name: "AMX Mod X: Set admin and moderator users"
run: |
export VPS_GAMESERVER_CONFIG_AMX_ADMINS="${{ vars.VPS_GAMESERVER_CONFIG_AMX_ADMINS }}"
envsubst '$VPS_GAMESERVER_CONFIG_AMX_ADMINS' < dodserver/serverfiles/dod/addons/amxmodx/configs/users.ini.template > dodserver/serverfiles/dod/addons/amxmodx/configs/users.ini
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>DoD 1.3 Community MOTD (https://discord.gg/dodcommunity)</title>
<title>$VPS_GAMESERVER_CONFIG_HOSTNAME MOTD</title>
<style>
html, body {
width: 100%;
Expand Down

0 comments on commit 5bf6fa8

Please sign in to comment.