Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
184 changes: 54 additions & 130 deletions .github/workflows/action-docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,170 +1,94 @@
name: Docker Publish

on:
workflow_dispatch:
push:
branches:
- main
paths:
- Dockerfile*
- Dockerfile
schedule:
- cron: "0 1 * * 6"

jobs:
build-ubuntu-2404:
name: Build Ubuntu 24.04
build:
name: Build Ubuntu ${{ matrix.version }}
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup QEMU
uses: docker/setup-qemu-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
gameservermanagers/linuxgsm
ghcr.io/gameservermanagers/linuxgsm
tags: |
latest
ubuntu
ubuntu-24.04

- name: Build and push (Ubuntu 24.04)
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.ubuntu-2404
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
strategy:
fail-fast: false
matrix:
include:
- version: "26.04"
tags: |
latest
ubuntu
ubuntu-26.04
- version: "24.04"
tags: ubuntu-24.04
- version: "22.04"
tags: ubuntu-22.04
- version: "20.04"
tags: ubuntu-20.04

build-ubuntu-2204:
name: Build Ubuntu 22.04
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v7

- name: Setup QEMU
uses: docker/setup-qemu-action@v3
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Login to Docker Hub
# uses: docker/login-action@v4
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
gameservermanagers/linuxgsm
ghcr.io/gameservermanagers/linuxgsm
tags: |
ubuntu-22.04

- name: Build and push (Ubuntu 22.04)
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.ubuntu-2204
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-ubuntu-2004:
name: Build Ubuntu 20.04
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup QEMU
uses: docker/setup-qemu-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v4
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
uses: docker/metadata-action@v6
with:
images: |
gameservermanagers/linuxgsm
ghcr.io/gameservermanagers/linuxgsm
tags: |
ubuntu-20.04
tags: ${{ matrix.tags }}

- name: Build and push (Ubuntu 20.04)
uses: docker/build-push-action@v6
- name: Build and push (Ubuntu ${{ matrix.version }})
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile.ubuntu-2004
file: ./Dockerfile
build-args: |
UBUNTU_VER=${{ matrix.version }}
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

package-cleanup:
name: Cleanup Old GitHub Packages
needs: [build-ubuntu-2004, build-ubuntu-2204, build-ubuntu-2404]
runs-on: ubuntu-latest
steps:
- name: Delete Package Versions
uses: actions/delete-package-versions@v5
with:
package-name: linuxgsm
package-type: container
min-versions-to-keep: 1
delete-only-untagged-versions: true
# package-cleanup:
# name: Cleanup Old GitHub Packages
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Delete Package Versions
# uses: actions/delete-package-versions@v5
# with:
# package-name: linuxgsm
# package-type: container
# min-versions-to-keep: 1
# delete-only-untagged-versions: true
23 changes: 17 additions & 6 deletions Dockerfile.ubuntu-2004 → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
# https://github.com/GameServerManagers/docker-linuxgsm
#

FROM ghcr.io/gameservermanagers/steamcmd:ubuntu-20.04
ARG UBUNTU_VER=26.04

FROM ghcr.io/gameservermanagers/steamcmd:ubuntu-${UBUNTU_VER}

ARG TARGETARCH=amd64
ARG SUPERCRONIC_VERSION=v0.2.48

USER root

Expand All @@ -23,6 +28,7 @@ ENV LGSM_DATADIR=/data/data
ENV LGSM_CONFIG=/data/config-lgsm
ENV LGSM_COMPRESSEDMAPSDIR=/data/Maps-Compressed
ENV LGSM_DEV=false
ENV LGSM_READ_CRONTAB=false
ENV GAMESERVER=jc2server
ENV VALIDATE_ON_START=false
ENV UPDATE_CHECK=60
Expand All @@ -46,7 +52,6 @@ RUN echo "**** Install Base LinuxGSM Requirements ****" \
bzip2 \
ca-certificates \
cpio \
cron \
curl \
distro-info \
file \
Expand All @@ -58,7 +63,7 @@ RUN echo "**** Install Base LinuxGSM Requirements ****" \
jq \
lib32gcc-s1 \
lib32stdc++6 \
netcat \
$(. /etc/os-release && case "$VERSION_ID" in "20.04"|"22.04") echo "netcat" ;; *) echo "netcat-openbsd" ;; esac) \
pigz \
python3 \
sudo \
Expand All @@ -81,15 +86,20 @@ RUN echo "**** Install Base LinuxGSM Requirements ****" \
&& rm -rf /tmp/* \
&& rm -rf /var/tmp/*

# Install supercronic
RUN echo "**** Install Supercronic ****" \
&& wget -O /usr/local/bin/supercronic https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/supercronic-linux-${TARGETARCH} \
&& chmod +x /usr/local/bin/supercronic

# Install Node.js
RUN echo "**** Install Node.js ****" \
&& set -uex \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& NODE_MAJOR=20 \
&& echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
&& NODE_MAJOR=24 \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install nodejs -y \
&& apt-get install nodejs -y --no-install-recommends \
&& apt-get -y autoremove \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/* \
Expand Down Expand Up @@ -142,6 +152,7 @@ RUN echo "$CACHEBUST"
COPY entrypoint.sh /app/entrypoint.sh
COPY entrypoint-user.sh /app/entrypoint-user.sh
COPY entrypoint-healthcheck.sh /app/entrypoint-healthcheck.sh
COPY cron-converter.sh /app/cron-converter.sh

## Ensure entrypoint scripts have execute permissions
RUN chmod +x /app/entrypoint.sh /app/entrypoint-user.sh /app/entrypoint-healthcheck.sh
Expand Down
Loading