Skip to content

Commit bc3d7b4

Browse files
committed
update workflow and steamcmd
1 parent cfe6a98 commit bc3d7b4

File tree

3 files changed

+109
-19
lines changed

3 files changed

+109
-19
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,65 +16,84 @@ permissions:
1616

1717
jobs:
1818
build:
19-
name: "Build and push ${{ matrix.tag }}:latest"
2019
runs-on: ubuntu-latest
2120
strategy:
2221
fail-fast: false
2322
matrix:
24-
tag:
25-
- steamcmd
26-
- docker-ark
23+
include:
24+
- name: "SteamCMD Interactive"
25+
image: steamcmd
26+
variant: interactive
27+
dockerfile: Dockerfile.interactive
28+
tags: |
29+
ghcr.io/${{ github.repository_owner }}/steamcmd:interactive
30+
docker.io/${{ github.repository_owner }}/steamcmd:interactive
31+
- name: "SteamCMD Non-Interactive"
32+
image: steamcmd
33+
variant: noninteractive
34+
dockerfile: Dockerfile.noninteractive
35+
tags: |
36+
ghcr.io/${{ github.repository_owner }}/steamcmd:noninteractive
37+
docker.io/${{ github.repository_owner }}/steamcmd:noninteractive
38+
ghcr.io/${{ github.repository_owner }}/steamcmd:latest
39+
docker.io/${{ github.repository_owner }}/steamcmd:latest
40+
- name: "Docker ARK Server"
41+
image: docker-ark
42+
variant: default
43+
dockerfile: Dockerfile
44+
tags: |
45+
ghcr.io/${{ github.repository_owner }}/docker-ark:latest
46+
docker.io/${{ github.repository_owner }}/docker-ark:latest
2747
2848
steps:
2949
- name: Checkout repository
3050
uses: actions/checkout@v4
3151
with:
3252
fetch-depth: 0
3353

34-
- name: Detect changes in ${{ matrix.tag }}
54+
- name: Detect changes
3555
id: changes
3656
uses: dorny/paths-filter@v3
3757
with:
3858
list-files: json
3959
filters: |
40-
${{ matrix.tag }}:
41-
- 'images/${{ matrix.tag }}/**'
60+
build:
61+
- images/${{ matrix.image }}/**
4262
4363
- name: Repository owner to lowercase
44-
if: ${{ steps.changes.outputs[matrix.tag] == 'true' }}
64+
if: steps.changes.outputs.build == 'true'
4565
id: lower-repo
4666
run: echo "repository=$(echo $GITHUB_REPOSITORY_OWNER | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
4767

4868
- name: Setup Docker Buildx
49-
if: ${{ steps.changes.outputs[matrix.tag] == 'true' }}
69+
if: steps.changes.outputs.build == 'true'
5070
uses: docker/setup-buildx-action@v3
5171

5272
- name: Login to GitHub Container Registry
53-
if: ${{ steps.changes.outputs[matrix.tag] == 'true' }}
73+
if: steps.changes.outputs.build == 'true'
5474
uses: docker/login-action@v3
5575
with:
5676
registry: ghcr.io
5777
username: ${{ github.repository_owner }}
5878
password: ${{ secrets.GITHUB_TOKEN }}
5979

6080
- name: Login to Docker Hub
61-
if: ${{ steps.changes.outputs[matrix.tag] == 'true' }}
81+
if: steps.changes.outputs.build == 'true'
6282
uses: docker/login-action@v3
6383
with:
6484
username: ${{ vars.DOCKERHUB_USERNAME }}
6585
password: ${{ secrets.DOCKERHUB_TOKEN }}
6686

67-
- name: Build and push to GHCR and DockerHub
68-
if: ${{ steps.changes.outputs[matrix.tag] == 'true' }}
87+
- name: Build and push
88+
if: steps.changes.outputs.build == 'true'
6989
uses: docker/build-push-action@v6
7090
with:
71-
context: ./images/${{ matrix.tag }}
72-
file: ./images/${{ matrix.tag }}/Dockerfile
91+
context: ./images/${{ matrix.image }}
92+
file: ./images/${{ matrix.image }}/${{ matrix.dockerfile }}
7393
platforms: linux/amd64
7494
push: true
7595
provenance: false
7696
cache-from: type=gha
7797
cache-to: type=gha,mode=max
7898
tags: |
79-
ghcr.io/${{ steps.lower-repo.outputs.repository }}/${{ matrix.tag }}:latest
80-
docker.io/${{ vars.DOCKERHUB_USERNAME }}/${{ matrix.tag }}:latest
99+
${{ matrix.tags }}

images/steamcmd/Dockerfile renamed to images/steamcmd/Dockerfile.interactive

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ RUN dpkg --add-architecture i386 \
2626
&& apt-get update \
2727
&& apt-get -y upgrade \
2828
&& apt-get -y install --no-install-recommends --no-install-suggests \
29-
ca-certificates \
3029
nano \
3130
locales \
3231
steamcmd \
3332
lib32gcc-s1 \
3433
lib32stdc++6 \
34+
ca-certificates \
3535
&& sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \
3636
&& locale-gen en_US.UTF-8 \
3737
&& update-locale LANG=en_US.UTF-8 \
@@ -67,4 +67,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
6767
CMD test -f "${STEAMCMDDIR}/steamcmd.sh" || exit 1
6868

6969
ENTRYPOINT ["./steamcmd.sh"]
70-
CMD ["+help", "+quit"]
70+
CMD ["+help"]
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#################################################
2+
# Copyright (c) Shardbyte. All Rights Reserved. #
3+
# SPDX-License-Identifier: MIT #
4+
#################################################
5+
#
6+
FROM debian:bookworm-slim
7+
8+
LABEL author="Shardbyte" maintainer="containers@shardbyte.com" \
9+
org.opencontainers.image.source="https://github.com/Shardbyte/shard-containers" \
10+
org.opencontainers.image.description="Application packaged by Shardbyte" \
11+
org.opencontainers.image.title="steamcmd" \
12+
org.opencontainers.image.licenses="MIT"
13+
14+
ARG PUID=1000
15+
ARG DEBIAN_FRONTEND=noninteractive
16+
ENV USER=steam
17+
ENV HOMEDIR="/home/${USER}"
18+
ENV STEAMCMDDIR="${HOMEDIR}/steamcmd" \
19+
LANG=en_US.UTF-8
20+
21+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
22+
RUN echo steam steam/question select "I AGREE" | debconf-set-selections \
23+
&& echo steam steam/license note '' | debconf-set-selections \
24+
&& sed -i 's/^Components: main$/& contrib non-free/' /etc/apt/sources.list.d/debian.sources
25+
26+
RUN dpkg --add-architecture i386 \
27+
&& apt-get update \
28+
&& apt-get -y upgrade \
29+
&& apt-get -y install --no-install-recommends --no-install-suggests \
30+
nano \
31+
locales \
32+
steamcmd \
33+
lib32gcc-s1 \
34+
lib32stdc++6 \
35+
ca-certificates \
36+
&& sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \
37+
&& locale-gen en_US.UTF-8 \
38+
&& update-locale LANG=en_US.UTF-8 \
39+
&& useradd -u "${PUID}" -m "${USER}" \
40+
&& mkdir -p "${STEAMCMDDIR}" \
41+
&& chown "${USER}:${USER}" "${STEAMCMDDIR}" \
42+
&& ln -s /usr/games/steamcmd "${STEAMCMDDIR}/steamcmd.sh" \
43+
&& ln -s /usr/games/steamcmd /usr/bin/steamcmd \
44+
&& apt-get -y autoremove \
45+
&& apt-get -y autoclean \
46+
&& apt-get -y clean \
47+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
48+
&& rm -rf /var/cache/debconf/*
49+
50+
USER ${USER}
51+
WORKDIR ${HOMEDIR}
52+
53+
RUN steamcmd +quit \
54+
&& mkdir -p "${HOMEDIR}/.steam/sdk32" "${HOMEDIR}/.steam/sdk64" \
55+
&& ln -s "${HOMEDIR}/.local/share/Steam/steamcmd/linux32" "${HOMEDIR}/.steam/sdk32" \
56+
&& ln -s "${HOMEDIR}/.local/share/Steam/steamcmd/linux64" "${HOMEDIR}/.steam/sdk64" \
57+
&& ln -s "${HOMEDIR}/.steam/sdk32/steamclient.so" "${HOMEDIR}/.steam/sdk32/steamservice.so" \
58+
&& ln -s "${HOMEDIR}/.steam/sdk64/steamclient.so" "${HOMEDIR}/.steam/sdk64/steamservice.so" \
59+
&& ln -s "${HOMEDIR}/.local/share/Steam/steamcmd/linux32/steamclient.so" "${STEAMCMDDIR}/steamservice.so" \
60+
&& ln -s "${HOMEDIR}/.local/share/Steam/steamcmd/linux64/steamclient.so" "${STEAMCMDDIR}/steamclient.so" \
61+
&& rm -rf "${HOMEDIR}/.steam/logs"/* \
62+
&& rm -rf "${HOMEDIR}/.local/share/Steam/logs"/* \
63+
&& rm -rf "${HOMEDIR}/.local/share/Steam/steamcmd/logs"/* \
64+
&& rm -rf "${HOMEDIR}/.cache/steam"/* 2>/dev/null || true
65+
66+
WORKDIR ${STEAMCMDDIR}
67+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
68+
CMD test -f "${STEAMCMDDIR}/steamcmd.sh" || exit 1
69+
70+
ENTRYPOINT ["./steamcmd.sh"]
71+
CMD ["+help", "+quit"]

0 commit comments

Comments
 (0)