forked from CM2Walki/steamcmd
-
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.
- Loading branch information
1 parent
015e41d
commit b7d2e33
Showing
3 changed files
with
112 additions
and
80 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,83 @@ | ||
name: Build and Push | ||
description: Builds and pushes the latest steamcmd image to GitHub Container Registry | ||
|
||
inputs: | ||
tag_name: | ||
description: "Tag name for the Docker image (or version tag)" | ||
required: true | ||
release: | ||
type: boolean | ||
description: "Is this a full release?" | ||
required: true | ||
github_token: | ||
description: "GitHub token for pushing to GitHub Container Registry" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Build | ||
shell: bash | ||
run: | | ||
cd $GITHUB_WORKSPACE/bullseye | ||
docker build \ | ||
--target=bullseye \ | ||
--tag ghcr.io/cfc-servers/steamcmd:${{ inputs.tag_name }} \ | ||
--tag ghcr.io/cfc-servers/steamcmd:steam \ | ||
. | ||
- name: Get docker-slim | ||
shell: bash | ||
run: | | ||
SLIM_VERSION=1.40.11 | ||
curl --location --output ds.tar.gz https://github.com/slimtoolkit/slim/releases/download/$SLIM_VERSION/dist_linux.tar.gz | ||
tar -xvzf ds.tar.gz | ||
mv dist_linux/* $GITHUB_WORKSPACE | ||
rm -rfv ds.tar.gz dist_linux/ | ||
- name: Make slim image | ||
shell: bash | ||
run: | | ||
version=${{ inputs.tag_name }} | ||
$GITHUB_WORKSPACE/docker-slim build \ | ||
--target ghcr.io/cfc-servers/steamcmd:$version \ | ||
--http-probe-off \ | ||
--show-clogs --show-blogs \ | ||
--tag ghcr.io/cfc-servers/steamcmd-slim:$version \ | ||
--tag ghcr.io/cfc-servers/steamcmd-slim:steam \ | ||
--exec '/home/steam/steamcmd/steamcmd.sh +login anonymous +app_info_update +app_info_print 4020 +logoff +quit' | ||
- name: Add latest tag | ||
shell: bash | ||
run: | | ||
BASE=ghcr.io/cfc-servers/steamcmd | ||
version=${{ inputs.tag_name }} | ||
# Tag image with "0.27" if we push tag "0.27.5" | ||
# but not if we push tag "0.27-pre5" | ||
minorVersion=${version%.*} | ||
if [[ $minorVersion != "0" ]]; then | ||
echo "::warning:: Tagging with parent minor version: $minorVersion" | ||
docker tag $BASE:$version $BASE:$minorVersion | ||
docker tag $BASE-slim:$version $BASE-slim:$minorVersion | ||
fi | ||
if [ "${{ inputs.release }}" = "true" ]; then | ||
echo "::warning:: Tagging this release as the latest!" | ||
docker tag $BASE:$version $BASE:latest | ||
docker tag $BASE-slim:$version $BASE-slim:latest | ||
fi | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ inputs.github_token }} | ||
|
||
- name: Tag and push slim images | ||
run: | | ||
docker push ghcr.io/cfc-servers/steamcmd --all-tags | ||
docker push ghcr.io/cfc-servers/steamcmd-slim --all-tags |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '18 4 */5 * *' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get Latest Tag | ||
id: latest_tag | ||
run: | | ||
latest_tag=$(git describe --tags --abbrev=0 --match='[0-9]*.[0-9]*.[0-9]*' --match='[0-9]*.[0-9]*' --exclude='*[^0-9.]*') | ||
echo "Latest tag: $latest_tag" | ||
echo "tag_name=$latest_tag" >> $GITHUB_OUTPUT | ||
- name: Push new build | ||
uses: ./.github/actions/build_and_push | ||
with: | ||
tag: ${{ steps.latest_tag.outputs.tag_name }} | ||
release: true | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |