File tree Expand file tree Collapse file tree
kubernetes/dedicated-servers/darkMessiah Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build & Publish Dark Messiah Server
2+
3+ on :
4+ push :
5+ paths :
6+ - ' kubernetes/dedicated-servers/darkMessiah/DockerFile'
7+ - ' kubernetes/dedicated-servers/darkMessiah/start.sh'
8+
9+ jobs :
10+ detect-and-build :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v3
16+
17+ - name : Filter for both files changed
18+ id : filter
19+ uses : dorny/paths-filter@v2
20+ with :
21+ filters : |
22+ both:
23+ - 'kubernetes/dedicated-servers/darkMessiah/DockerFile'
24+ - 'kubernetes/dedicated-servers/darkMessiah/start.sh'
25+
26+ - name : Skip if not both
27+ if : steps.filter.outputs.both != 'true'
28+ run : |
29+ echo "No changes in both Dockerfile and start.sh → skipping"
30+ exit 0
31+
32+ - name : Log in to GitHub Container Registry
33+ uses : docker/login-action@v2
34+ with :
35+ registry : ghcr.io
36+ username : ${{ github.actor }}
37+ password : ${{ secrets.CR_PAT }}
38+
39+ - name : Build and push Docker image
40+ uses : docker/build-push-action@v4
41+ with :
42+ context : .
43+ file : ./kubernetes/dedicated-servers/darkMessiah/DockerFile
44+ push : true
45+ tags : |
46+ ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:dark-messiah
47+ ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest
Original file line number Diff line number Diff line change 1+ # Dockerfile
2+ FROM ubuntu:22.04
3+
4+ # 1. Instala dependencias y Wine
5+ RUN dpkg --add-architecture i386 \
6+ && apt-get update \
7+ && apt-get install -y --no-install-recommends \
8+ wine64 wine32 \
9+ wget unzip xvfb \
10+ lib32gcc-s1 lib32stdc++6 \
11+ && rm -rf /var/lib/apt/lists/*
12+
13+ # 2. Crea usuario y directorios
14+ RUN useradd -m steam
15+ USER steam
16+ WORKDIR /home/steam
17+
18+ # 3. Instala SteamCMD
19+ RUN mkdir steamcmd \
20+ && cd steamcmd \
21+ && wget -qO- https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz \
22+ | tar zxvf - \
23+ && cd ..
24+
25+ # 4. Descarga el servidor dedicado (Windows) vía SteamCMD
26+ RUN ./steamcmd/steamcmd.sh +login anonymous \
27+ +force_install_dir /home/steam/dm_srv \
28+ +app_update 2145 validate +quit
29+
30+ # 5. Copia el script de arranque
31+ COPY --chown=steam:steam start.sh .
32+
33+ ENTRYPOINT ["bash", "start.sh"]
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Inicia un framebuffer virtual
3+ Xvfb :0 -screen 0 1024x768x16 &
4+
5+ # Variables por defecto (puedes pasarlas como env vars)
6+ : " ${PORT:= 27015} "
7+ : " ${MAXPLAYERS:= 16} "
8+ : " ${MAP:= arena_big} "
9+
10+ cd /home/steam/dm_srv
11+
12+ # Ejecuta srcds.exe bajo Wine
13+ exec wine cmd /c " srcds.exe -game dmom \
14+ +port ${PORT} \
15+ +maxplayers ${MAXPLAYERS} \
16+ +map ${MAP} \
17+ +exec server.cfg"
You can’t perform that action at this time.
0 commit comments