-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: reorganize CI/CD action and workflow files
- Loading branch information
1 parent
1964231
commit bb5b15c
Showing
6 changed files
with
88 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup OpenSSH | ||
uses: ./.github/actions/_shared/setup-openssh | ||
- name: Execute the restart command through OpenSSH | ||
run: ssh -i ~/.ssh/${{ env.VPS_GAMESERVER_OPENSSH_ID }} ${{ env.VPS_GAMESERVER_USERNAME }}@${{ env.VPS_HOSTNAME }} -p 22 "${{ env.VPS_GAMESERVER_BINARY }} restart" | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup OpenSSH | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "${{ env.VPS_GAMESERVER_OPENSSH_PRIVATE_KEY }}" > ~/.ssh/${{ env.VPS_GAMESERVER_OPENSSH_ID }} | ||
chmod 600 ~/.ssh/${{ env.VPS_GAMESERVER_OPENSSH_ID }} | ||
ssh-keyscan ${{ env.VPS_HOSTNAME }} >> ~/.ssh/known_hosts | ||
shell: bash |
42 changes: 42 additions & 0 deletions
42
.github/actions/continuous-deployment/deploy-gaming-server-files/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup OpenSSH | ||
uses: ./.github/actions/_shared/setup-openssh | ||
- 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: "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="${{ env.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: "Server configuration: Set hostname, RCON password, and download URL" | ||
run: | | ||
export VPS_GAMESERVER_CONFIG_HOSTNAME="${{ env.VPS_GAMESERVER_CONFIG_HOSTNAME }}" | ||
export VPS_GAMESERVER_CONFIG_RCON_PASSWORD="${{ env.VPS_GAMESERVER_CONFIG_RCON_PASSWORD }}" | ||
export VPS_GAMESERVER_CONFIG_DOWNLOAD_URL="${{ env.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: "MOTD: Set meta title" | ||
run: | | ||
export VPS_GAMESERVER_CONFIG_HOSTNAME="${{ env.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="${{ env.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 | ||
rm -f dodserver/serverfiles/dod/addons/amxmodx/configs/users.ini.template | ||
shell: bash | ||
- name: Set execute permissions for the gaming server files | ||
run: find dodserver/serverfiles/dod -type f -exec chmod 755 {} \; | ||
shell: bash | ||
- name: Synchronize the gaming server files | ||
run: rsync -e "ssh -i ~/.ssh/${{ env.VPS_GAMESERVER_OPENSSH_ID }}" -avvzP --delete --exclude='.*' ${{ env.VPS_GAMESERVER_RSYNC_SOURCE_PATH }} ${{ env.VPS_GAMESERVER_USERNAME }}@${{ env.VPS_HOSTNAME }}:${{ env.VPS_GAMESERVER_RSYNC_DEST_PATH }} | ||
shell: bash |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters