-
-
Notifications
You must be signed in to change notification settings - Fork 4
72 lines (59 loc) · 2.21 KB
/
build_and_push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Build and Push
on:
workflow_dispatch:
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
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get docker-slim
run: |
SLIM_VERSION=1.40.9
curl -L -o ds.tar.gz https://downloads.dockerslim.com/releases/$SLIM_VERSION/dist_linux.tar.gz
tar -xvzf ds.tar.gz
mv dist_linux/* $GITHUB_WORKSPACE
rm -rfv ds.tar.gz dist_linux/
- name: Build starter images
run: |
cd $GITHUB_WORKSPACE/docker
docker build --build-arg="GMOD_BRANCH=live" --tag gluatest_fat_live:latest .
docker build --build-arg="GMOD_BRANCH=x86-64" --tag gluatest_fat_x86-64:latest .
- name: Make slim images
run: |
cd $GITHUB_WORKSPACE/docker
BASE=ghcr.io/cfc-servers/gluatest
$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 }}
$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 }}
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
fi
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.GH_TOKEN }}
- name: Tag and push slim images
run: |
docker push ghcr.io/cfc-servers/gluatest --all-tags
docker push ghcr.io/cfc-servers/gluatest/64bit --all-tags