From d8f26497c2a04b3096477ddf43889e894c3f2023 Mon Sep 17 00:00:00 2001 From: Snider Date: Sun, 1 Feb 2026 16:34:16 +0000 Subject: [PATCH] fix(ci): correct GHCR image names and branch triggers - Use separate image repos (ghcr.io/host-uk/core-dev, server-php) - Trigger on dev branch instead of main - Only build LinuxKit on tags - Add fail-fast: false to continue if one image fails Co-Authored-By: Claude Opus 4.5 --- .github/workflows/build.yml | 42 +++++++++++++------------------------ 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8da07b8..4490c94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,22 +1,21 @@ # Host UK Container Images -# Publishes to both GHCR (org access) and Docker Hub (public) +# Publishes to GHCR with separate image repos # -# GHCR: ghcr.io/host-uk/core-images:{image} -# Docker Hub: lthn/{image}:{version} +# GHCR: ghcr.io/host-uk/core-dev +# GHCR: ghcr.io/host-uk/server-php name: Build Images on: push: - branches: [main, dev] + branches: [dev] tags: ['v*'] pull_request: - branches: [main, dev] + branches: [dev] workflow_dispatch: env: GHCR_REGISTRY: ghcr.io - DOCKERHUB_ORG: lthn jobs: # ============================================================ @@ -30,15 +29,16 @@ jobs: packages: write strategy: + fail-fast: false matrix: image: - developer - server-php include: - image: developer - dockerhub_name: core-dev + ghcr_name: core-dev - image: server-php - dockerhub_name: server-php + ghcr_name: server-php steps: - name: Checkout @@ -58,34 +58,22 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata id: meta uses: docker/metadata-action@v5 with: images: | - ${{ env.GHCR_REGISTRY }}/host-uk/core-images - ${{ env.DOCKERHUB_ORG }}/${{ matrix.dockerhub_name }} + ${{ env.GHCR_REGISTRY }}/host-uk/${{ matrix.ghcr_name }} tags: | - # Tag image variant for GHCR (core-images:developer) - type=raw,value=${{ matrix.image }},enable=${{ github.ref == 'refs/heads/main' }} - # Branch name (core-images:dev, lthn/core-dev:dev) - type=ref,event=branch,suffix=-${{ matrix.image }},enable=${{ github.ref != 'refs/heads/main' }} - type=ref,event=branch,enable=${{ github.ref != 'refs/heads/main' }} + # dev branch -> dev tag + type=ref,event=branch # PR number type=ref,event=pr - # Semver tags (v1.0.0 -> 1.0.0, 1.0, 1) + # Semver tags (v1.0.0 -> 1.0.0, 1.0, 1, latest) type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} - # Latest on main - type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} + type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }} flavor: | latest=false @@ -101,13 +89,13 @@ jobs: cache-to: type=gha,mode=max # ============================================================ - # Build LinuxKit Images + # Build LinuxKit Images (only on tags) # ============================================================ linuxkit: name: LinuxKit (${{ matrix.image }}-${{ matrix.arch }}) runs-on: ubuntu-latest needs: docker - if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/v') strategy: matrix: