From 0125c77b1886cde3ea854b38fc8be64d915ccba6 Mon Sep 17 00:00:00 2001 From: Aurora <53442028+ChocoboCoding@users.noreply.github.com> Date: Tue, 7 Jul 2026 22:46:56 +0200 Subject: [PATCH 1/6] added image build CI file (#2) --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..66ed23a9c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: build prod container image and push to registry + +on: + push: + branches: + - main + workflow_dispatch: + inputs: + tags: + description: Tag to push the image with + required: false + type: string + +jobs: + build: + runs-on: ubuntu-latest + name: Build prod container + permissions: + packages: write + contents: read + env: + REGISTRY: ghcr.io + IMAGE: ghcr.io/${{ github.repository }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Login to registry + run: buildah login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} $REGISTRY + + - name: Build latest image + run: | + buildah bud -t $IMAGE:latest . + buildah push $IMAGE:latest + + - name: Build tagged image + if: inputs.tags + run: | + buildah bud -t $IMAGE:${{ inputs.tags }} . + buildah push $IMAGE:${{ inputs.tags }} \ No newline at end of file From 2df88b7fc0e1d2e3913e9ad6bfa5a16e644f0813 Mon Sep 17 00:00:00 2001 From: Aurora Date: Tue, 7 Jul 2026 22:48:57 +0200 Subject: [PATCH 2/6] hardcoded image for testing --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66ed23a9c..c26fceb95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,8 @@ jobs: contents: read env: REGISTRY: ghcr.io - IMAGE: ghcr.io/${{ github.repository }} +# IMAGE: ghcr.io/${{ github.repository }} + IMAGE: ghcr.io/chocobocoding/teiserver steps: - name: Checkout code uses: actions/checkout@v4 From 4f799863a1e0faa889bbf04eabc4b7abd20db094 Mon Sep 17 00:00:00 2001 From: Aurora Date: Tue, 7 Jul 2026 23:12:07 +0200 Subject: [PATCH 3/6] removed hardcoded image for testing --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c26fceb95..66ed23a9c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,8 +20,7 @@ jobs: contents: read env: REGISTRY: ghcr.io -# IMAGE: ghcr.io/${{ github.repository }} - IMAGE: ghcr.io/chocobocoding/teiserver + IMAGE: ghcr.io/${{ github.repository }} steps: - name: Checkout code uses: actions/checkout@v4 From f05df120a9afcef731ce1f4ae6769cfa2b43a38b Mon Sep 17 00:00:00 2001 From: Aurora Date: Tue, 7 Jul 2026 23:26:59 +0200 Subject: [PATCH 4/6] updated to create tagged image on release --- .github/workflows/build.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66ed23a9c..d19a721de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,12 +4,9 @@ on: push: branches: - main - workflow_dispatch: - inputs: - tags: - description: Tag to push the image with - required: false - type: string + release: + types: + - published jobs: build: @@ -34,7 +31,7 @@ jobs: buildah push $IMAGE:latest - name: Build tagged image - if: inputs.tags + if: github.event_name == 'release' run: | - buildah bud -t $IMAGE:${{ inputs.tags }} . - buildah push $IMAGE:${{ inputs.tags }} \ No newline at end of file + buildah bud -t $IMAGE:${{ github.event.release.tag_name }} . + buildah push $IMAGE:${{ github.event.release.tag_name }} \ No newline at end of file From cca36c21a5ed1dfd612275ad604f48561c304288 Mon Sep 17 00:00:00 2001 From: Aurora Date: Thu, 9 Jul 2026 02:20:13 +0200 Subject: [PATCH 5/6] added sha tagged image, and deduplicated builds --- .github/workflows/build.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d19a721de..8cf222b9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,13 +25,15 @@ jobs: - name: Login to registry run: buildah login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} $REGISTRY - - name: Build latest image - run: | - buildah bud -t $IMAGE:latest . - buildah push $IMAGE:latest + - name: Build image + run: buildah bud -t $IMAGE:latest . - - name: Build tagged image + - name: Push latest image + run: buildah push $IMAGE:latest + + - name: Push sha tagged image + run: buildah push $IMAGE:latest $IMAGE:${{ github.sha }} + + - name: Push tagged image if: github.event_name == 'release' - run: | - buildah bud -t $IMAGE:${{ github.event.release.tag_name }} . - buildah push $IMAGE:${{ github.event.release.tag_name }} \ No newline at end of file + run: buildah push $IMAGE:latest $IMAGE:${{ github.event.release.tag_name }} \ No newline at end of file From 79a8e15d547faf1c096750be825312f23eaae291 Mon Sep 17 00:00:00 2001 From: Aurora Date: Thu, 9 Jul 2026 10:37:51 +0200 Subject: [PATCH 6/6] hardcoded namespace and name for testing --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8cf222b9d..74923de1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: contents: read env: REGISTRY: ghcr.io - IMAGE: ghcr.io/${{ github.repository }} + IMAGE: ghcr.io/chocobocoding/teiserver steps: - name: Checkout code uses: actions/checkout@v4