Skip to content

Commit

Permalink
update README, teamplate, CI
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyShorokhov committed Apr 5, 2024
1 parent ff9ed96 commit c2cd4ae
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/.teamplate-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ docker run --rm -ti -p 27015:27015/udp $dockerUser/$mod:public ./hlds_run -game
### CMD
The default `CMD` for an image is:
```Dockerfile
CMD ["bash", "-c", "./hlds_run -game $mod +ip 0.0.0.0 -port 27016 +map $(head -n 1 ./${MOD}/mapcycle.txt)"]]
CMD ["bash", "-c", "./hlds_run -game $mod +ip 0.0.0.0 -port 27016 +map $(grep -oE '^\\s*(\\w+)' ./${MOD}/mapcycle.txt | head -n 1 | xargs)"]]
```

> [!NOTE]
> `$(head -n 1 ./${MOD}/mapcycle.txt)` - takes the first line (map name) from $mod/mapcycle.txt to enable the server.
> `$(grep -oE '^\\s*(\\w+)' ./${MOD}/mapcycle.txt | head -n 1 | xargs)` - takes the first line (map name) from $mod/mapcycle.txt to enable the server.
These values allow you to execute a string of initialization commands before calling the game binary.

Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ jobs:
- tfc
- ricochet
- dmc
exclude:
- mod: dod
branch: steam_legacy
- mod: gearbox
branch: steam_legacy
- mod: tfc
branch: steam_legacy
- mod: ricochet
branch: steam_legacy
- mod: dmc
branch: steam_legacy

env:
needToPush: ${{ github.ref == 'refs/heads/master' }}

Expand All @@ -53,6 +65,7 @@ jobs:
push: ${{ env.needToPush }}
tags: |
${{ vars.DOCKER_USERNAME }}/${{ matrix.mod }}:${{ matrix.branch }}
${{ matrix.branch == 'public' && format('{0}/{1}:latest', vars.DOCKER_USERNAME, matrix.mod) || null}}
build-args: |
APPBRANCH=${{ matrix.branch }}
MOD=${{ matrix.mod }}
Expand Down
204 changes: 178 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,121 @@ Automated builder of Docker images for Half-Life Dedicated Server (HLDS).
The base image is [Debian](https://hub.docker.com/_/debian).

### Images
| Image | Tags | Pulls | Image size |
| - | - | - | - |
| HLDS valve | [`public`, `steam_legacy`](https://hub.docker.com/r/hldsdocker/valve/tags) | [![Docker Pulls](https://img.shields.io/docker/pulls/hldsdocker/valve?logo=docker&logoColor=blue)](https://hub.docker.com/r/hldsdocker/valve) | [![Docker Image Size](https://img.shields.io/docker/image-size/hldsdocker/valve?logo=docker&logoColor=blue)](https://hub.docker.com/r/hldsdocker/valve) |
| HLDS cstrike | [`public`, `steam_legacy`](https://hub.docker.com/r/hldsdocker/cstrike/tags) | [![Docker Pulls](https://img.shields.io/docker/pulls/hldsdocker/cstrike?logo=docker&logoColor=blue)](https://hub.docker.com/r/hldsdocker/cstrike) | [![Docker Image Size](https://img.shields.io/docker/image-size/hldsdocker/cstrike?logo=docker&logoColor=blue)](https://hub.docker.com/r/hldsdocker/cstrike) |
| HLDS czero | [`public`, `steam_legacy`](https://hub.docker.com/r/hldsdocker/czero/tags) | [![Docker Pulls](https://img.shields.io/docker/pulls/hldsdocker/czero?logo=docker&logoColor=blue)](https://hub.docker.com/r/hldsdocker/czero) | [![Docker Image Size](https://img.shields.io/docker/image-size/hldsdocker/czero?logo=docker&logoColor=blue)](https://hub.docker.com/r/hldsdocker/czero) |
| HLDS dod | [`public`](https://hub.docker.com/r/hldsdocker/dod/tags) | [![Docker Pulls](https://img.shields.io/docker/pulls/hldsdocker/dod?logo=docker&logoColor=blue)](https://hub.docker.com/r/hldsdocker/dod) | [![Docker Image Size](https://img.shields.io/docker/image-size/hldsdocker/dod?logo=docker&logoColor=blue)](https://hub.docker.com/r/hldsdocker/dod) |
| HLDS gearbox | [`public`](https://hub.docker.com/r/hldsdocker/gearbox/tags) | [![Docker Pulls](https://img.shields.io/docker/pulls/hldsdocker/gearbox?logo=docker&logoColor=blue)](https://hub.docker.com/r/hldsdocker/gearbox) | [![Docker Image Size](https://img.shields.io/docker/image-size/hldsdocker/gearbox?logo=docker&logoColor=blue)](https://hub.docker.com/r/hldsdocker/gearbox) |
| HLDS tfc | [`public`](https://hub.docker.com/r/hldsdocker/tfc/tags) | [![Docker Pulls](https://img.shields.io/docker/pulls/hldsdocker/tfc?logo=docker&logoColor=blue)](https://hub.docker.com/r/hldsdocker/tfc) | [![Docker Image Size](https://img.shields.io/docker/image-size/hldsdocker/tfc?logo=docker&logoColor=blue)](https://hub.docker.com/r/hldsdocker/tfc) |
<table>
<thead>
<tr>
<th>Image</th>
<th>Tags</th>
<th>Pulls</th>
<th>Image size</th>
</tr>
</thead>
<tbody>
<tr>
<td>HLDS valve</td>
<td><a href="https://hub.docker.com/r/hldsdocker/valve/tags"><code>public</code>,
<code>steam_legacy</code></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/valve"><img
src="https://img.shields.io/docker/pulls/hldsdocker/valve?logoColor=blue"
alt="Docker Pulls"></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/valve"><img
src="https://img.shields.io/docker/image-size/hldsdocker/valve?logoColor=blue"
alt="Docker Image Size"></a></td>
</tr>
<tr>
<td>HLDS cstrike</td>
<td><a href="https://hub.docker.com/r/hldsdocker/cstrike/tags"><code>public</code>,
<code>steam_legacy</code></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/cstrike"><img
src="https://img.shields.io/docker/pulls/hldsdocker/cstrike?logoColor=blue"
alt="Docker Pulls"></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/cstrike"><img
src="https://img.shields.io/docker/image-size/hldsdocker/cstrike?logoColor=blue"
alt="Docker Image Size"></a></td>
</tr>
<tr>
<td>HLDS czero</td>
<td><a href="https://hub.docker.com/r/hldsdocker/czero/tags"><code>public</code>,
<code>steam_legacy</code></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/czero"><img
src="https://img.shields.io/docker/pulls/hldsdocker/czero?logoColor=blue"
alt="Docker Pulls"></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/czero"><img
src="https://img.shields.io/docker/image-size/hldsdocker/czero?logoColor=blue"
alt="Docker Image Size"></a></td>
</tr>
<tr>
<td>HLDS dod</td>
<td><a href="https://hub.docker.com/r/hldsdocker/dod/tags"><code>public</code></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/dod"><img
src="https://img.shields.io/docker/pulls/hldsdocker/dod?logoColor=blue"
alt="Docker Pulls"></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/dod"><img
src="https://img.shields.io/docker/image-size/hldsdocker/dod?logoColor=blue"
alt="Docker Image Size"></a></td>
</tr>
<tr>
<td>HLDS gearbox</td>
<td><a href="https://hub.docker.com/r/hldsdocker/gearbox/tags"><code>public</code></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/gearbox"><img
src="https://img.shields.io/docker/pulls/hldsdocker/gearbox?logoColor=blue"
alt="Docker Pulls"></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/gearbox"><img
src="https://img.shields.io/docker/image-size/hldsdocker/gearbox?logoColor=blue"
alt="Docker Image Size"></a></td>
</tr>
<tr>
<td>HLDS tfc</td>
<td><a href="https://hub.docker.com/r/hldsdocker/tfc/tags"><code>public</code></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/tfc"><img
src="https://img.shields.io/docker/pulls/hldsdocker/tfc?logoColor=blue"
alt="Docker Pulls"></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/tfc"><img
src="https://img.shields.io/docker/image-size/hldsdocker/tfc?logoColor=blue"
alt="Docker Image Size"></a></td>
</tr>
<tr>
<td>HLDS ricochet</td>
<td><a href="https://hub.docker.com/r/hldsdocker/ricochet/tags"><code>public</code></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/ricochet"><img
src="https://img.shields.io/docker/pulls/hldsdocker/ricochet?logoColor=blue"
alt="Docker Pulls"></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/ricochet"><img
src="https://img.shields.io/docker/image-size/hldsdocker/ricochet?logoColor=blue"
alt="Docker Image Size"></a></td>
</tr>
<tr>
<td>HLDS dmc</td>
<td><a href="https://hub.docker.com/r/hldsdocker/dmc/tags"><code>public</code></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/dmc"><img
src="https://img.shields.io/docker/pulls/hldsdocker/dmc?logoColor=blue"
alt="Docker Pulls"></a></td>
<td><a href="https://hub.docker.com/r/hldsdocker/dmc"><img
src="https://img.shields.io/docker/image-size/hldsdocker/dmc?logoColor=blue"
alt="Docker Image Size"></a></td>
</tr>
</tbody>
</table>

### Tags
| Name | Description |
| - | - |
| `public` | Latest depots update |
| `steam_legacy` | Pre-25th Anniversary Build |
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>public</code></td>
<td>Latest depots update</td>
</tr>
<tr>
<td><code>steam_legacy</code></td>
<td>Pre-25th Anniversary Build</td>
</tr>
</tbody>
</table>

### How it works
At [00:00 on Sunday](https://github.com/hldsdocker/hlds/blob/67b4583a400a210b87198b923be6c6fa128bc0d4/.github/workflows/CI.yml#L12C3-L13C24) using [GitHub Actions](https://github.com/hldsdocker/hlds/actions), all images are automatically [rebuilt and published](https://github.com/hldsdocker/hlds/blob/67b4583a400a210b87198b923be6c6fa128bc0d4/.github/workflows/CI.yml#L54-L66) to Docker Hub (https://hub.docker.com/u/hldsdocker).
Expand All @@ -37,32 +138,83 @@ The description for Docker Hub repositories (of each mod) is dynamically generat
### Depots
A depot is a logical grouping of files which are all delivered to a customer as a single group.

| Content files | URL |
| - | - |
| Base Goldsrc Shared Content | https://steamdb.info/depot/1/ |
| Counter-Strike Base Content | https://steamdb.info/depot/11/ |
| Condition Zero Base Content | https://steamdb.info/depot/81/ |
<table>
<thead>
<tr>
<th>Content files</th>
<th>URL</th>
</tr>
</thead>
<tbody>
<tr>
<td>Base Goldsrc Shared Content</td>
<td><a href="https://steamdb.info/depot/1/">https://steamdb.info/depot/1/</a></td>
</tr>
<tr>
<td>Counter-Strike Base Content</td>
<td><a href="https://steamdb.info/depot/11/">https://steamdb.info/depot/11/</a></td>
</tr>
<tr>
<td>Condition Zero Base Content</td>
<td><a href="https://steamdb.info/depot/81/">https://steamdb.info/depot/81/</a></td>
</tr>
</tbody>
</table>

[Read more about depots](https://partner.steamgames.com/doc/store/application/depots) in Steamworks documentation.

### Branches
An application can have multiple branches. Other than the "public" branch, there can be other branches. Other branches are often used for storing an older version of the game for people to downgrade to, or for testing new patches/content. These can often be found in the "Betas" tab in the app's properties in the Steam client. Some branches might require a password, and they won't be visible in the drop-down list until the correct password is entered.

A list of possible branches and depots can be found here:
| Game | Depots link |
| - | - |
| valve | https://steamdb.info/app/70/depots/ |
| cstrike | https://steamdb.info/app/10/depots/ |
| сzero | https://steamdb.info/app/80/depots/ |
<table>
<thead>
<tr>
<th>Game</th>
<th>Depots link</th>
</tr>
</thead>
<tbody>
<tr>
<td>valve</td>
<td><a href="https://steamdb.info/app/70/depots/">https://steamdb.info/app/70/depots/</a></td>
</tr>
<tr>
<td>cstrike</td>
<td><a href="https://steamdb.info/app/10/depots/">https://steamdb.info/app/10/depots/</a></td>
</tr>
<tr>
<td>сzero</td>
<td><a href="https://steamdb.info/app/80/depots/">https://steamdb.info/app/80/depots/</a></td>
</tr>
</tbody>
</table>


[Read more about branches](https://partner.steamgames.com/doc/store/application/branches) in Steamworks documentation.

## Secrets and Variables for GitHub Actions
| Type | Key | Description |
| - | - | - |
| Variable | `DOCKER_USERNAME` | DockerHub user account |
| Secret | `DOCKER_PASSWORD` | DockerHub user password |
<table>
<thead>
<tr>
<th>Type</th>
<th>Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Variable</td>
<td><code>DOCKER_USERNAME</code></td>
<td>DockerHub user account</td>
</tr>
<tr>
<td>Secret</td>
<td><code>DOCKER_PASSWORD</code></td>
<td>DockerHub user password</td>
</tr>
</tbody>
</table>

Read more about [secrets](https://docs.github.com/en/actions/learn-github-actions/variables#using-the-vars-context-to-access-configuration-variable-values) and [variables](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions)
in GitHub Docs.

0 comments on commit c2cd4ae

Please sign in to comment.