Skip to content

Commit

Permalink
Conditional minor tag
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonsturgeon committed Jan 30, 2024
1 parent bbb3b03 commit e784bc4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/build_and_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,39 @@ jobs:
cd $GITHUB_WORKSPACE/docker
BASE=ghcr.io/cfc-servers/gluatest
rawVersionTag=${{ inputs.tag_name }}
publicID=$(cat $GITHUB_WORKSPACE/gmod_buildid_public.txt)
$GITHUB_WORKSPACE/docker-slim build \
--target gluatest_fat_live:latest \
--http-probe-off \
--continue-after 30 \
--show-clogs --show-blogs \
--tag "$BASE":${{ inputs.tag_name }} \
--tag "$BASE":gameversion-$publicID
--tag $BASE:$rawVersionTag \
--tag $BASE:gameversion-$publicID
x86ID=$(cat $GITHUB_WORKSPACE/gmod_buildid_x86.txt)
$GITHUB_WORKSPACE/docker-slim build \
--target gluatest_fat_x86-64:latest \
--http-probe-off \
--continue-after 30 \
--show-clogs --show-blogs \
--tag "$BASE"/64bit:${{ inputs.tag_name }} \
--tag "$BASE"/64bit:gameversion-$x86ID
--tag $BASE/64bit:$rawVersionTag \
--tag $BASE/64bit:gameversion-$x86ID
# Tag image with "0.27" if we push tag "0.27.5"
# but not if we push tag "0.27-pre5"
parentMinorVersion=${rawVersionTag%.*}
if [[ parentMinorVersion != "0" ]]; then
echo "::warning:: Tagging with parent minor version: $parentMinorVersion"
docker tag $BASE:$rawVersionTag $BASE:$parentMinorVersion
docker tag $BASE/64bit:$rawVersionTag $BASE:$parentMinorVersion
fi
if [ "${{ inputs.release }}" = "true" ]; then
echo "::warning:: Tagging this release as the latest!"
docker tag "$BASE":${{ inputs.tag_name }} "$BASE":latest
docker tag "$BASE"/64bit:${{ inputs.tag_name }} "$BASE"/64bit:latest
docker tag $BASE:$rawVersionTag $BASE:latest
docker tag $BASE/64bit:$rawVersionTag $BASE/64bit:latest
fi
- name: Login to GitHub Container Registry
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.8"

services:
runner:
image: ghcr.io/cfc-servers/gluatest:0.27-pre19
image: ghcr.io/cfc-servers/gluatest:0.27-pre21
build: .
container_name: gluatest_runner
stop_grace_period: 2s
Expand Down

0 comments on commit e784bc4

Please sign in to comment.