feat: simplify CI to single unified Docker build

Remove 3-variant matrix (full/lite/cuda). Single build produces
a multi-arch manifest (amd64 + arm64) pushed to Docker Hub and GHCR.
Tags: latest, X.Y.Z, X.Y, X. CI builds native platform only (amd64)
for speed. Multi-arch only on release.
This commit is contained in:
Siddharth Kumar Sah
2026-04-10 00:24:43 +08:00
parent 986ad37bb5
commit b385a2eabb
2 changed files with 12 additions and 48 deletions
+4 -19
View File
@@ -80,20 +80,8 @@ jobs:
- run: pnpm build - run: pnpm build
docker: docker:
name: Docker Build Test (${{ matrix.tag }}) name: Docker Build Test
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
include:
- tag: full
variant: full
gpu: "false"
- tag: lite
variant: lite
gpu: "false"
- tag: cuda
variant: full
gpu: "true"
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -104,9 +92,6 @@ jobs:
context: . context: .
file: docker/Dockerfile file: docker/Dockerfile
push: false push: false
build-args: | tags: stirling-image:ci
VARIANT=${{ matrix.variant }} cache-from: type=gha,scope=unified
GPU=${{ matrix.gpu }} cache-to: type=gha,mode=max,scope=unified
tags: stirling-image:ci-${{ matrix.tag }}
cache-from: type=gha,scope=${{ matrix.tag }}
cache-to: type=gha,mode=max,scope=${{ matrix.tag }}
+8 -29
View File
@@ -49,28 +49,10 @@ jobs:
fi fi
docker: docker:
name: Docker (${{ matrix.tag }}) name: Docker Build & Push
needs: release needs: release
if: needs.release.outputs.new_version != '' if: needs.release.outputs.new_version != ''
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
include:
- tag: full
variant: full
gpu: "false"
suffix: ""
platforms: "linux/amd64,linux/arm64"
- tag: lite
variant: lite
gpu: "false"
suffix: "-lite"
platforms: "linux/amd64,linux/arm64"
- tag: cuda
variant: full
gpu: "true"
suffix: "-cuda"
platforms: "linux/amd64"
steps: steps:
- name: Checkout release tag - name: Checkout release tag
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -104,10 +86,10 @@ jobs:
stirlingimage/stirling-image stirlingimage/stirling-image
ghcr.io/${{ github.repository }} ghcr.io/${{ github.repository }}
tags: | tags: |
type=semver,pattern={{version}}${{ matrix.suffix }},value=v${{ needs.release.outputs.new_version }} type=semver,pattern={{version}},value=v${{ needs.release.outputs.new_version }}
type=semver,pattern={{major}}.{{minor}}${{ matrix.suffix }},value=v${{ needs.release.outputs.new_version }} type=semver,pattern={{major}}.{{minor}},value=v${{ needs.release.outputs.new_version }}
type=semver,pattern={{major}}${{ matrix.suffix }},value=v${{ needs.release.outputs.new_version }} type=semver,pattern={{major}},value=v${{ needs.release.outputs.new_version }}
type=raw,value=${{ matrix.tag == 'full' && 'latest' || matrix.tag }} type=raw,value=latest
- name: Build and push - name: Build and push
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
@@ -115,11 +97,8 @@ jobs:
context: . context: .
file: docker/Dockerfile file: docker/Dockerfile
push: true push: true
build-args: | platforms: linux/amd64,linux/arm64
VARIANT=${{ matrix.variant }}
GPU=${{ matrix.gpu }}
platforms: ${{ matrix.platforms }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.tag }} cache-from: type=gha,scope=unified
cache-to: type=gha,mode=max,scope=${{ matrix.tag }} cache-to: type=gha,mode=max,scope=unified